Friday, May 16, 2008

API enhancement allows sending email campaign with on-the-fly personalization data

We have enhanced the "Send" API methods to allow you to pass in on-the-fly personalization data, along with email addresses. Therefore you can now send a personalized email campaign in one single method call without sending to a JangoMail Group.

Traditionally, when using the API to send a personalized email campaign, you would have to first create a Group with AddGroup, then add or import members to the Group with AddGroupMember or ImportGroupMembersFromData, and then send to the Group with SendMassEmail. You can still do this if you prefer, but now there's an easier way as well. The following methods are affected:

  • SendMassEmail
    Sends a mass e-mail with a plain text and/or HTML e-mail. Returns a string.
  • SendMassEmailPrevious2
    New method. Sends a previously saved mass e-mail to a new set of recipients. Returns a string.
  • SendMassEmailRaw
    Sends a mass e-mail, given a raw message including MIME parts and a MIME boundary. Returns a string.

  • To pass in personalization data, use the ToOther input parameter to pass in the actual set of data. The set of data can be in comma-separated form or in any other row and column delimited format that you choose. You may use whatever row and comma delimiter you like for the data in ToOther. The ToOther parameter should only contain the data, and not the field names for the data.

    Use the Options input parameter to specify the field names and the row and column delimiters for the data in ToOther. The Options parameter is a comma-delimited list of attribute/value pairs. The attributes relevant to this feature are:


    You can use these character codes for their corresponding delimiters:

    "c" represents a comma
    "s" represents a space
    "n" represents a newline, or a hard break
    "t" represents a tab

    The ToOtherFieldNames attribute must be a pipe (|) delimited list of field names corresponding to the data in ToOther.

    Let's do an example!

    I want to send a personalized email campaign to 3 people, and I want to use First Name and Last Name as additional personalization data.



    Hello %%FirstName%%

    Hello %%FirstName%% %%LastName%% -- your email address is %%EmailAddress%%