If you are using transactional email templates, you can use this request to insert personalised information into the templates before the emails are sent. This is especially useful when sending password reminder emails, voucher codes, or account balances.

When using this request, you must specify the template by using the template hash associated with it, provide us with the tag that will be used to personalise the email, and provide the data that will be substituted into the tag when the email is sent.

The Method

RESTPOSThttps://[Your URL]/api/2.0/trans_mails/template

Your method must be structured as follows:


Required Parameters

You must specify the template hash, the placeholder tag, and the data that will be substituted into the placeholder when the email is sent.

$identifierstringThis is the unique template identifier, assigned to each template when it is created.noneyes
$emailsarrayThe email addresses which this email must be sent to.noneyes
$tagsarrayList of common tags in the template.noneyes
$unique_tagsarrayThe unique tags, such as email address or new password, which must be included in the email.noneyes
$settingsarrayTransactional sending settings, these would be the same as the settings when sending a normal transactional email.noneyes

Code Samples


$template_hash = 'hash here';
$emails = array('[email protected]' => 'Example name');
$common_tags = array('common_tag_placeholder' => 'Common tag data');
$unique_tags = array('[email protected]' => array('unique_tag_placeholder' => 'unique tag data'));
$result = $api->send($template_hash, $emails, $common_tags = [], $unique_tags = [], $attachments = []);


  "identifier": "sJWnzzH5VzOiZ8Ki",
  "emails": {"[email protected]": "Example name"},
  'settings': {},
  'tags' : {"common_tag_placeholder": "Common data"}
  'unique_tags' : {"[email protected]": {"unique_tag_placeholder": "Unique data"}}