-
Notifications
You must be signed in to change notification settings - Fork 17
List Management API Calls
12and1studio edited this page Nov 5, 2014
·
2 revisions
# define a responsys member
responsys_member = Responsys::Member.new("email_address")
# specify the email list in which the member resides
email_list = Responsys::Api::Object::InteractObject.new("folder_name", "list_name")
def subscribed?
response = responsys_member.subscribed?(email_list)
return false if response.is_a?(Hash) && response[:status] && response[:status] == "failure"
response
end
responsys_member.unsubscribe(email_list)
responsys_member.subscribe(email_list)
subscribe = true
responsys_member.add_to_list(email_list, subscribe)
*requires the member's riid
data = [{RIID_: 12345, EMAIL_ADDRESS_: "email_address"}]
record = Responsys::Api::Object::RecordData.new(data)
# build a merge rule that will match a record according to the riid
rule = Responsys::Api::Object::ListMergeRule.new(matchColumnName1: "RIID_")
Responsys::Api::Client.instance.merge_list_members(email_list, record, rule)