1

i started to use the Marketing Cloud recently but i'm facing some problems to update a Preference Attribute using the FuelSDK (ruby). So, basically i can just update the profile attribute seding the content through the API (sending the desired field on the Attributes tag during the SOAP request), but i can't do the same strategy to update a Preference Attribute.

Currently, i'm interesting to set some values (Profile and Preferences attributes) when i create a subscriber triggering a first email for the user (when the user create a new account) through the Triggered Email action.

I don't really know how i can update a Preference Attribute using the FuelSdk.

If someone could give some tips, i would appreciate it.

Thanks!

3
  • What happens when you try to create a subscriber(code.exacttarget.com/apis-sdks/fuel-sdks/subscribers/…) while including preference attributes? Commented Feb 13, 2015 at 15:26
  • @DrewSimmons nothing happens. I have a Preference Attribute called HasAccount that i'm interesting to update when i create a subscriber. You can see the field in that image dropbox.com/s/4oal6erdjy90jwp/… Commented Feb 17, 2015 at 20:04
  • Have you tried treating preference attributes as other properties? Something like this?: require 'fuelsdk' myClient = FuelSDK::Client.new {'client' => { 'id' => CLIENTID, 'secret' => SECRET }} subscriber = FuelSDK::Subscriber.new subscriber.authStub = myclient subscriber.props = {.., ..., ..., "Has Account" => true} results = subscriber.post p results Commented Feb 17, 2015 at 22:28

1 Answer 1

0

Preference Attribute updates work fine for me:

def set_preference(emaiL_address, preference_name, new_value)
  new_subscriber = FuelSDK::Subscriber.new
  new_subscriber.authStub = @auth
  new_subscriber.props = {
    "EmailAddress" => emaiL_address,
    "Attributes" => [ { 'Name' => preference_name, 'Value' => new_value } ]
  }
  results = new_subscriber.patch
  puts "Setting: #{emaiL_address} set property #{preference_name} => #{new_value}, code=#{results.code}"
end

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .