Module: BurstSms::ListsAddRecipient

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

Defined Under Namespace

Classes: Response

Instance Method Summary collapse

Instance Method Details

#add_list_recipient(list_id, mobile, options = {}) ⇒ Object



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

def add_list_recipient(list_id, mobile, options={})
  response = post_to_api(add_list_recipient_body(list_id, mobile, options))
  Response.parse(response.body)
end

#add_list_recipient_body(list_id, mobile, options = {}) ⇒ Object



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

def add_list_recipient_body(list_id, mobile, options={})
  build_request("contact-lists.add-recipient",  :mobile => mobile,
                                                :list_id => list_id,
                                                :firstname => (options.has_key?(:firstname) ? options[:firstname] : nil),
                                                :lastname => (options.has_key?(:lastname) ? options[:lastname] : nil),
                                                :mobile_dest_country => (options.has_key?(:mobile_dest_country) ? options[:mobile_dest_country] : nil)
                                                )
end