Description
After a template has been entered into the system, the need may arise to update template information. This method allows you to change any settings and data associated with an existing template. The call only updates the test version of the template so it doesn't affect live messages being sent while testing modifications.
Arguments
Field | Description | Field Type | Required | Example |
---|---|---|---|---|
template_id | The template identification number associated with the template you wish to update. | number | Yes | 1234 |
subject | A string value containing the subject line of the message when sent to the transactional recipient | string | No | Your BB Order Confirmation |
from_description | A string value that populates the "From:" value in the message header, along with the from email address. Email clients commonly display this value in the users' inbox. | string | No | Buffalo Barn |
from_email | A string value that populates the "From:" value in the message header, along with the From Description | string | No | orders@buffalobarn.com |
reply_email | A string that populates the "Reply-To:" value in the message header. | string | No | orders@buffalobarn.com |
template_data | An array consisting of two elements: html and plain. Because of the nature of XML, the HTML and Plain Text message content should be wrapped in CDATA tags.
|
string | No | see example below |
message_notes | Allows you to submit message notes that can be referenced later. | string | No | Order confirmation email for our shoe store customers |
bill_codes | Allows you to submit a billing code that can be referenced later. | string | No | welcome_email_shoes |
track_links | A Boolean value when set to 1 will track all links in the message. By default, links are tracked unless the track_links are part of the api call and the value of the elements are set to zero. | boolean | No | 1 |
track_roi | A Boolean value when set to 1 will add the ROI append to your links, allowing for ROI information to be tracked. By default, ROI is turned on and links are tracked unless the track_roi and track_links are part of the api call and the value of the elements are set to zero. | boolean | No | 1 |
link_append | This argument enables you to add query string parameters to tracked links in your transactional message. | string | No | src=email_campaign&dept=123 |
set_status | Deactivated messages will neither display on the account statistics nor be sent when sendTransaction calls are made. | boolean | No | 1 |
binding | This parameter is used to specify a specific IP address binding to be used for a transactional message template. Contact your Account Manager to find out which bindings are available for you to use. | string | No | echo |
Response
Field | Description | Example |
---|---|---|
template_id | The ID number identifying the template being modified; it is identical to the value passed in by the POST | 1055589 |
Response Codes
responseCode | responseText | Description |
---|---|---|
202 | Template ID [template_id] has been updated | The test version of the template has been successfully updated. |
425 | XML Error: Please verify the XML request is valid. For special characters please ensure you are using blocks and url encoding data properly | Typically caused when the HTML content of the message template is not contained within a CDATA tag. |
426 | Invalid Template Data | Typically caused when the <template_date>, <html>, or the <plain> elements are missing from the POST payload. |
427 | No data passed to update Template ID <templateID> | The POST payload did not include anything or the message template ID was missing from the URI. |
428 | Missing variable | Required elements are missing from the POST payload. The <responseData> element will contain one or more <missing_vars> elements identifying the missing required variables. |
429 | Invalid Template ID | The Template ID does not exist |
444 | Invalid binding value | The IP Binding specified is not assigned to this account |
446 | No XML data passed | XML elements were not included in the API method call |
448 | Invalid or Inactive Template ID | The Template ID provided in the input parameter is either invalid or inactive. |
Example Post
<methodCall>
<methodName>transactional.updatetemplate</methodName>
<template_id>1055589</template_id>
<template_data>
<html>
<![CDATA[ ... HTML content goes here ...]]>
</html>
<plain>
<![CDATA[ ... Plain Text content goes here ...]]>
</plain>
</template_data>
<subject>Thank you for ordering</subject>
<from_description>Buffalo Barn</from_description>
<from_email>from@buffalobarn.com</from_email>
<reply_email>replies@buffalobarn.com</reply_email>
<track_links>1</track_links>
<track_roi>1</track_roi>
</methodCall>
Example Response
<methodResponse>
<item>
<methodName>transactional.updatetemplate</methodName>
<responseText>Template ID 1055589 has been updated.</responseText>
<responseData>
<template_id>1055589</template_id>
</responseData>
</item>
</methodResponse>