code: def event_return(events):
      '''
      Send the events to a mattermost room.
  
      :param events:      List of events
      :return:            Boolean if messages were sent successfully.
      '''
      _options = _get_options()
  
      api_url = _options.get('api_url')
      channel = _options.get('channel')
      username = _options.get('username')
      hook = _options.get('hook')
  
      is_ok = True
      for event in events:
          log.debug('Event: %s', event)
          log.debug('Event data: %s', event['data'])
          message = 'tag: {0}\r\n'.format(event['tag'])
          for key, value in six.iteritems(event['data']):
              message += '{0}: {1}\r\n'.format(key, value)
          result = post_message(channel,
                                message,
                                username,
                                api_url,
                                hook)
          if not result:
              is_ok = False
  
      return is_of event_return(events):
      '''
      Send the events to a mattermost room.
  
      :param events:      List of events
      :return:            Boolean if messages were sent successfully.
      '''
      _options = _get_options()
  
      api_url = _options.get('api_url')
      channel = _options.get('channel')
      username = _options.get('username')
      hook = _options.get('hook')
  
      is_ok = True
      for event in events:
          log.debug('Event: %s', event)
          log.debug('Event data: %s', event['data'])
          message = 'tag: {0}\r\n'.format(event['tag'])
          for key, value in six.iteritems(event['data']):
              message += '{0}: {1}\r\n'.format(key, value)
          result = post_message(channel,
                                message,
                                username,
                                api_url,
                                hook)
          if not result:
              is_ok = False
  
      return is_ok
docs: Send the events to a mattermost room.
  
      :param events:      List of events
      :return:            Boolean if messages were sent successfully.