Deliver multiple messages created using Clockwork::API#messages.build.
 @return [array] Array of Clockwork::SMS::Response objects for messages.
963192
def deliver
      xml = Clockwork::XML::SMS.build_multiple( self.messages )
      http_response = Clockwork::HTTP.post( Clockwork::API::SMS_URL, xml, @use_ssl )
      responses = Clockwork::XML::SMS.parse_multiple( self.messages, http_response )
    end
1031151
def create
			@message = Message.new(message_params)

			if @message.valid?
				MessageMailer.message_me(@message).deliver_now
				redirect_to new_message_path, notice: "Thank you for your message."
			else
				render :new
			end
		end
548431
def actors
      request = Message::List.new(Thread.mailbox)
      list = send_request request
      list.map!(&:to_sym)
    end
568646
def push(self):
        ''''''
        message = self.build_message()
        return requests.post(self.hook, json=message)
432749
def process(method_name, *args) #:nodoc:
      payload = {
        carrier: self.class.name,
        action: method_name
      }

      ActiveSupport::Notifications.instrument("process.sms_carrier", payload) do
        super
        @_message = NullMessage.new unless @_sms_was_called
      end
    end
989246
def build_message(self):
        '''
        '''
        if self._text is None:
            raise InvalidPayloadError('text is required')

        message = {
            'text': self._text,
            'markdown': self._markdown
        }

        if self._channel != Incoming.DEFAULT_CHANNEL:
            message['channel'] = self._channel

        if self._attachments:
            message['attachments'] = []
            for attachment in self._attachments:
                if 'title' not in attachment and 'text' not in attachment:
                    raise InvalidPayloadError('title or text is required')
                message['attachments'].append(attachment)

        return message
718299
def receive_message(queue_url: nil, max_number_of_messages: nil)
      queue = queue_by_url queue_url
      r = MockResponse.new
      r.messages = Array(queue.messages.shift max_number_of_messages) if queue.messages.any?
      r
    end
66817
def send_messages(events)
      $logger.debug { "ApiClient#send_messages(#{events.inspect})" }
      messages_api = TriglavClient::MessagesApi.new(@api_client)
      handle_error { messages_api.send_messages(events) }
    end
555724
def recent_messages(limit = nil, &callback)
      connection.http(:get, "/room/#{id}/recent.json", (limit ? { :limit => limit } : nil)) do |data, http|
        callback.call(data[:messages].map { |msg| Firering::Message.instantiate(connection, msg) }) if callback
      end
    end
1300699
def send_messages(self, email_messages):
        
        if not email_messages:
            return

        num_sent = 0
        for message in email_messages:
            if self._send(message):
                num_sent += 1

        return num_sent
912560
def _deliver_message(self, msg):
        
        my_subscribed_actions = self.subscriptions.get(msg.sender, [])
        for action in my_subscribed_actions:
            if Global.CONFIG_MANAGER.tracing_mode:
                Global.LOGGER.debug(f"delivering message to {action.name}")
            action.on_input_received(msg)
306611
def sms(*args)
      message = ''
      options = {}
      args.each do |arg|
        case arg
        when String
          message = arg
        when Hash
          options.merge!(arg)
        else
          raise ArgumentError, 'sms expects STring or Hash argument'
        end
      end

      output { @xml.Sms(message, options) }
    end
182588
def reply_text_message(from=nil, to=nil, content)
      message = TextReplyMessage.new
      message.FromUserName = from || @weixin_message.ToUserName
      message.ToUserName   = to   || @weixin_message.FromUserName
      message.Content      = content
      encrypt_message message.to_xml
    end
295120
def deliver_later!
      ActionMessenger::MessageDeliveryJob.perform_later(self.class.name, 'deliver_now!', messenger_class.to_s, method_name.to_s, *args)
    end
770268
def next_message
      message = nil

      if block_given?
        index = @messages.index do |msg|
          yield(msg) || msg.is_a?(SystemEvent)
        end

        message = @messages.slice!(index, 1).first if index
      else
        message = @messages.shift
      end

      message
    end
434556
def flush
      failed_messages = []
      new_token_messages = []

      @queued_messages.each do |service, messages|
        service.init_push
        messages.each do |message|
          service.send(message)
        end
        (failed, new_token) = service.end_push
        failed_messages += failed
        new_token_messages += new_token
      end
      @queued_messages = {}
      return FlushResult.new(failed_messages, new_token_messages)
    end
892295
def build_emitters(tokens)
      tokens.map do |token|
        yield(token) || Emitters::String.new(token)
      end
    end