transactional.insertTemplate
    • 2 Minutes to read
    • Dark
      Light

    transactional.insertTemplate

    • Dark
      Light

    Article summary

    General Information

    When setting up a brand new template, you'll first need to run the method "transactional.inserttemplate". This inserts a template into your system, including both the live version and the test version. The API will return back to you the Template ID of the template you just inserted, which you will use later to update, rebuild, or send a transactional message.

    Arguments

    Field

    Description

    Field Type

    Required

    Example

    subject

    A string value containing the subject line of the message when sent to the transactional recipient

    string

    Yes

    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

    Yes

    Buffalo Barn

    from_email

    A string value that populates the "From:" value in the message header, along with the From Description

    string

    Yes

    orders@​buffalobarn.com

    reply_email

    A string that populates the "Reply-To:" value in the message header.

    string

    Yes

    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.

    • Html – The HTML content of the transactional message.

    • Plain – The Plain Text content of the transactional message.

    string

    Yes

    see example below

    message_notes

    Allows you to submit message notes that can be


    referenced later.

    string

    No

    The 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 is 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 is 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

    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 just created

    1055589

    Response Codes

    responseCode

    responseText

    responseData

    Description

    203

    Template ID [template_id] cache has been rebuilt


    A new transactional message template has been created.

    425

    XML Error: Please verify the XML request is valid. For special characters please ensure you are using

    <error>No memory at line: 24</error>

    HTML and plain text content not enclosed in CDATA tags

    426

    Invalid Template Data


    <template_data> element is missing either the <html> or the <plain> elements, or either are blank values.

    427

    No data passed to update Template ID {template_ID}


    Data is missing from the POSTed input

    428

    Missing variables

    <missing_vars>from_description</missing_vars>

    Missing <from_description> element or blank value is POSTed

    428

    Missing variables

    <missing_vars>subject</missing_vars>

    Missing <subject> element or blank value is POSTed

    428

    Missing variables

    <missing_vars>from_email</missing_vars>

    Missing <from_email> element or blank value is POSTed

    428

    Missing variables

    <missing_vars>reply_email</missing_vars>

    Missing <reply_email> element or blank value is POSTed

    428

    Missing variables

    <missing_vars>template_data</missing_vars>

    Missing <template_data> element or blank value is POSTed

    444

    Invalid binding value


    Binding is not assigned to the client

    Example Post

    <methodCall>
    <methodName>transactional.insertTemplate</methodName>
    <template_data>
    <html>
    <![CDATA[ ... HTML content goes here ...]]>
    </html>
    <plain>
    <![CDATA[ ... Plain Text content goes here ...]]>
    </plain>
    </template_data>
    <subject>Order Confirmation</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.inserttemplate</methodName>
    <responseText>Template ID 991243 cache has been rebuilt</responseText>
    <responseData>
    <template_id>1055589</template_id>
    </responseData>
    </item>
    </methodResponse>


    Was this article helpful?