lib/createsend/subscriber.rb in createsend-6.0.0 vs lib/createsend/subscriber.rb in createsend-6.1.0

- old
+ new

@@ -21,19 +21,21 @@ Hashie::Mash.new(response) end # Adds a subscriber to a subscriber list. def self.add(auth, list_id, email_address, name, custom_fields, resubscribe, - consent_to_track, restart_subscription_based_autoresponders=false) + consent_to_track, restart_subscription_based_autoresponders=false, mobile_number=nil, consent_to_send_sms=nil) options = { :body => { :EmailAddress => email_address, :Name => name, + :MobileNumber => mobile_number, :CustomFields => custom_fields, :Resubscribe => resubscribe, :RestartSubscriptionBasedAutoresponders => restart_subscription_based_autoresponders, - :ConsentToTrack => consent_to_track }.to_json } + :ConsentToTrack => consent_to_track, + :ConsentToSendSms => consent_to_send_sms }.to_json } cs = CreateSend.new auth response = cs.post "/subscribers/#{list_id}.json", options response.parsed_response end @@ -68,20 +70,22 @@ end # Updates any aspect of a subscriber, including email address, name, and # custom field data if supplied. def update(new_email_address, name, custom_fields, resubscribe, - consent_to_track, restart_subscription_based_autoresponders=false) + consent_to_track, restart_subscription_based_autoresponders=false, mobile_number=nil, consent_to_send_sms=nil) options = { :query => { :email => @email_address }, :body => { :EmailAddress => new_email_address, :Name => name, + :MobileNumber => mobile_number, :CustomFields => custom_fields, :Resubscribe => resubscribe, :RestartSubscriptionBasedAutoresponders => restart_subscription_based_autoresponders, - :ConsentToTrack => consent_to_track }.to_json } + :ConsentToTrack => consent_to_track, + :ConsentToSendSms => consent_to_send_sms }.to_json } put "/subscribers/#{@list_id}.json", options # Update @email_address, so this object can continue to be used reliably @email_address = new_email_address end \ No newline at end of file