Subscriber.update not working?

Trying to do a subscriber updated as given by an example from the ruby gem
@subscriber.update new_email, "Subscriber", custom_fields, true

Every time I get an arguments error (4 for 1)

Then I tried
custom_fields = [ { :Key => 'url', :Value => '' + self.url } ]
body = {:EmailAddress =>, :Name=>, :CustomFields => custom_fields}
subscriber.update body

And that gives no error but the value is not updated. Any hints?

This in rails by the way.

jamesd jamesd, 5 years ago

I'm going to assume you're using the latest version of the createsend gem.

If you're looking at the subscriber tests, you will see that the @subscriber is created in the context block:

@subscriber = "your list id", ""

So, you need to create your subscriber object with the existing email address (as a subscriber is identified by the list ID and email address combination), and then call update on that subscriber:

@subscriber.update "", "Subscriber", [], true

If the call above produced an arguments error, the tests would not be passing. And they are passing (run rake test to check).

200,000 companies around the world can't be wrong.

From Australia to Zimbabwe, and everywhere in between, companies count on 
Campaign Monitor for email campaigns that drive real business results.

Get started for free