Including merge fields in email sent by the API

I am sending a custom created (by code) HTML email to 100’s of people via an API call. How can I include merge fields in the resulting email that get resolved when sent?

Using the normal campaign merge fields did not work. ~contact.email~, for example here.

I guess it will not matter if you are using the XML-RPC or REST versions of the Send Email function here.

The XML-RPC version of the documentation has an example below.
https://developer.infusionsoft.com/docs/xml-rpc/#email-send-an-email

I am wondering if the Merge Fields are Case Sensitive here, try ~Contact.Email~ to see if it makes a difference.

Thanks Pav, Yes Merge Fields are case sensitive…I remembered that late yesterday (well was reminded of that, actually).

Appreciate your reply!

1 Like