Campaign_Create_Transactional

Campaign_Create_Transactional( string keystruct testContact,struct testReplacementsstring campaignNamestring subject,string senderEmailstring senderNamestruct contentoptionalstruct optionalParameters)

Note: When using one of the API wrappers, you do not need to pass the API key. The wrapper will pass the key for you, your first parameter should be the second parameter in the signature.

Description

Create a transactional mail2 campaign

A transactional campaign is sent to one recipient at a time for a specific purpose with replacement values for tokens specific to that message. Ex: sending a user's authorization
code following a signup action on your site. Replacements will override the value of a custom field with the same name in the Campaign

If the content of your email included a string {activation_code}, your replacements could contain {'activation_code':'123'},
and that value would be used only for this instance of the transactional campaign

Parameters

  string key Your API key - used to authenticate your account
  struct testContact An initial contact to receive a test copy of the transactional email
testContact is a struct, which can contain:
- email => value
- customFieldToken => value
- customFieldId => value

A testContact must have a valid email

Ex:
testContact = {"email":"test@mail2.com", "first_name":"Test", "last_name":"User"}
testContact = {"email":"support@mail2.com", 1:"Support", 2:"User"}
  struct testReplacements An initial set of test replacement values to be used for the testEmail
  string campaignName The name of this Campaign - not shown to recipients
  string subject The subject line of the Campaign
  string senderEmail The from email address of the Campaign
  string senderName The from name of the Campaign
  struct content A struct which specifies the content of the Campaign email - can include html and text
string html The HTML body of your message
string text The plain text body of your message


At least one of html or text must be provided. If both are provided, the message will be sent as a multipart message

optional struct optionalParameters A struct of optional parameters, see below for valid keys

optionalParameters can include:

bool authenticate Defaults to false. Authentication applies certain identifiers to your message to let the receiving servers know where the message is coming from. This helps with delivery of large mailings to major ISPs and some spam filters who often look for these identifiers to determine if a message is legit or not.
string replyToEmail Defaults to senderEmail. The email address that replies to your Campaign should go to. This will be overridden if you set trackReplies to true.
string replyToName Defaults to senderName. The display name of the replyToEmail
bool trackReplies Defaults to false. Whether or not replies should be tracked in your Campaign Report. Setting this to true will override your replyToEmail
string recipientName The display name of your recipient. Can use Personalization Tokens
bool showInArchive Defaults to false. Whether or not this message should be show in your message archive.
bool viewInBrowser Defaults to false. Whether or not this message should include a "View In Browser" link.
bool trackOpens Defaults to true. Whether or not opens for this message should be tracked in your Campaign Report
bool trackClickThruHTML Defaults to true. Whether or not click tracking for links in the HTML body of this message should be tracked in your Campaign Report
bool trackClickThruText Defaults to true. Whether or not click tracking for links in the text body of this message should be tracked in your Campaign Report
string googleAnalyticsName Defaults to blank. If this is set, Google Analytics tracking will be turned on for this message with the specified name
string clickTaleName Defaults to blank. If this is set, ClickTale tracking will be turned on for this message with the specified name. Please note: you'll need to have ClickTale setup on your web site in order to use this feature.
array clickTaleCustomFields Defaults to blank. Accepts an array of CustomField IDs. clickTaleName must be set when using this parameter. Please do not use any personally identifiable information when using the ClickTale integration. This might include: First Name, Last Name, Company Name, Phone Number and Email Address. This policy applies to any other field that could identify your email subscriber within ClickTale tracking. Please note: you'll need to have ClickTale setup on your web site in order to use this feature.
array customUrlParameters The custom parameters to be appended to all urls orgainized into key / value pairs
int footerId Defaults to your account's default footer. Set this to a valid footer ID to cause this campaign to use that footer
struct facebookAutopost A struct which contains information required to automatically post to Facebook upon completion of the campaign
int facebookAccount The Facebook account id used to post
string facebookLocation The Facebook location used to post. If no location is given the post will be to the wall of the specified account.
string facebookName The post name
string facebookDescription The post description
string facebookPicture The post picture used
struct twitterAutopost A struct which contains information required to automatically post to Twitter upon completion of the campaign
int twitterAccount The Twitter account id used to post
bool appendFooter Defaults to true. Whether or not a footer should be automatically appended to your message content

Return

int campaignId The ID for your new Campaign
 

Still need help? Contact Us Contact Us