InfusionSoft XML-RPC Opt-in an Email Address method always returns false


(Tim Brogdon) #1

Hi,

We integrated our .NET project to InfusionSoft to create contacts. We could create the contact. However, the contacts’ email status are either “Unconfirmed” or “Non-marketable”. We are unable to send the email to contacts because of this reason.

All API calls to APIEmailService.optIn returned 'False".

.NET SDK we use: https://github.com/EventDay/Infusionsoft.net/tree/master/src/InfusionSoft
XML-RPC: https://developer.infusionsoft.com/docs/xml-rpc/#email-opt-in-an-email-address

We have 4 contact forms, these are the opt-in reasons we use.

  1. Joined via contact us form.
  2. Interested in ReceptionistPlus.
  3. Interested in MyAssistant.
  4. Interested in Corporate Solutions.

Email address is the value the user entered on contact form which is validated by regular expression too.

Sample code

 switch (campaignId)
 {
    case 512: _infsoft.AddContactToOptin(Request["Email"], "Interested in ReceptionistPlus."); break;
    case 331: _infsoft.AddContactToOptin(Request["Email"], "Interested in MyAssistant."); break;
    case 399: _infsoft.AddContactToOptin(Request["Email"], "Interested in Corporate Solutions."); break;
 }	 
 public bool AddContactToOptin(string Email, string optInReason)
 {
    return client.EmailService.OptIn(Email, optInReason);			
 }

 public virtual bool OptIn(string email, string optInReason)
 {
     return Invoke(d => d.OptIn(ApiKey, email, optInReason));
 }

(Tom Scott) #2

That SDK isn’t one published by us, so all I can say is that we have not had any issues reported on the XML-RPC method itself; would you be able to get in with a debugger and see what the actual POST-body payload is and post it here, minus your API key?


(Tim Brogdon) #3

Hi Tom,

Thanks for your feedback. We have finally ressolved the issue. It seems that it didn’t work when we creat the contact and opt in the email address. It seems to work when we opt in the email address before creating the contact.


(Nick Connicdev) #4

Returns false for me too; but works(returns true) on the first call only; so make sure you haven’t made the call before for the same email addresses.