APIEmailSservice.optin

I have problem updating the email optin setting for contacts. Does this call need to be made in the same session as ContactService.add ? Trying to call it after contact has been added is failing silently…

I read a post on stackoverflow.com in which the developer reported success when using 3 methods together in one session (I assume)

  1. ContactServer.add
  2. ContactService.addToGroup
  3. APIEmailService.optin

FYI we are using FileMaker pro with XMLrpc plugin with success for other functions, so I don’t think this is the issue.

Are these new Email Addresses, or have they been added in before?

Are all the parameters being filled in for the API function?
https://developer.infusionsoft.com/docs/xml-rpc/#email-opt-in-an-email-address

@Ben_Marchbanks, The optin service can be run regardless of current status as long as the email already exists. Technically speaking, it is NOT specifically tied to a contact. Email records stand alone. If they exist and are not already opted in then you will get a response of true. If they exist and are already opted in you will get a response of false. If they exist but have previously been opted out then you will get a response of false because the api is not allowed to opt in an opted out email address. You can determine the optin status by reading the EmailAddStatus table with a query for the specific email address.

Hope that helps.

I believe you can opt an email address in via the API only once. If the email gets opted out, you can not opt it back in with the API.

Thanks,
Casey

If this is a case of previously opted out emails, as Casey_Page stated, then you may use a workaround of submitting a web form from your code (using cURL) for these emails to get them opted in again.

@yugene,

While it is true that this is a “hack” that would work, it enters one into a compromising situation in relationship to the user agreement with infusionsoft and, in the case of most opt-outs that indeed wanted to be opted out, would generate a high level of spam complaints and reports which would only create a much bigger problem for anyone putting this into practice. It is therefor, highly recommended not to use programming to opt in previous opt outs.

@John_Borelli I saw above where you can opt in via API. Once we are getting the contact record into Infusionsoft via API, it is showing a Non-Marketable status. Is there a way we can change this to when they are imported it shows Marketable?

Yes, there is a separate method called optIn() that you just pass that email address to. It will then show up in your IS app as unconfirmed which is the equivalent of a single opt in. It is not possible to manage double optins (confirmed) through the api. That much must be done with an email link. But the optIn() method will make your contact marketable.