Module: BurstSms::MessagesMultiple

Included in:
API
Defined in:
lib/burstsms/messages_multiple.rb

Defined Under Namespace

Classes: Response

Instance Method Summary collapse

Instance Method Details

#send_message(from, recipients, message, options = {}) ⇒ Object



6
7
8
9
# File 'lib/burstsms/messages_multiple.rb', line 6

def send_message(from, recipients, message, options={})
  @response = post_to_api(send_message_body(from, recipients, message, options))
  Response.parse(@response.body)
end

#send_message_body(from, recipients, message, options = {}) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/burstsms/messages_multiple.rb', line 11

def send_message_body(from, recipients, message, options={})
  build_request("messages.multiple",  :mobile => sanitize_numbers(recipients),
                                      :caller_id => check_valid_sender(from), 
                                      :message => encode_msg(message),
                                      :sendtime => (options.has_key?(:sendtime) ? options[:sendtime] : nil),
                                      :validity => (options.has_key?(:validity) ? options[:validity] : nil),
                                      :contact_list => (options.has_key?(:contact_list) ? options[:contact_list] : nil))
end