transactional.sendTest

‹ BACK TO API PAGE


Description

In the event the marketer needs to test a message, the system has an alternate sending method with this method. Sending through this method sends the test version of the template. No statistics are recorded when sending through this method. If the template has link tracking on, test messages insert the actual URL instead of the redirected one. Using this method allows the marketer to test changes after updating the template, without affecting the live template. Tests may include anything from grammar to rendering in multiple email clients.

Arguments

Field Description Field Type Required Example
email The email address you wish to send the test transactional message to. string Yes jsmith@example.com
template_id The template identification number of the template you wish to send. number Yes 1234
email_preference A string consisting of one of three values: mime, html, and plain.
This determines which version of the message the system will send
the recipient. Defaults to 'mime'.
string No mime
name A string value that populates the "To:" value in the message header
with the email address.
string No James Smith
subject A string value containing the subject line of the message when sent to the transactional recipient.
Will override the default template value.
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.
Will override the default template value.
string No Buffalo Barn
from_email A string value that populates the "From:" value in the message
header, along with the From Description.
Will override the default template value.
string No orders@buffalobarn.com
reply_email A string that populates the "Reply-To:" value in the message header.
Will override the default template value.
string No orders@buffalobarn.com
check_optout A Boolean value that when set to 1 will check the email address against the system optout database and will not send if the contact has previously opted out. number No 1
{$smarty} variables Refer to the Smarty Templating guide here. string No see examples below using {order_id}
do_not_log A Boolean value to indicate whether or not to store this specific method call in the API Request Log and the Historical Sent Log. This ensures a degree of security from anyone accessing the Logs and viewing any elements that have highly sensitive values.
  • 0 – Log as usual (default)
  • 1 – Do not log
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
use_standard_footer A Boolean value that when set to 1 will include the standard footer in the message. Otherwise no footer is used. boolean No 1

Response

Field Description Example
template_id Template ID number of the template used to send the test message. It will be the same Template ID that was sent in the POST 1055589
email Email address of the person that the test message was sent to. It will be the same email address that was sent in the POST jsmith@example.com
contact_id This value will always be returned as "test" "test"

Response Codes

responseCode responseText responseData Description
201 Sent transaction The test transactional message has been sent.
203 Template ID [template_id]-test cache has been rebuilt. The transactional message template has been successfully refreshed.
428 Missing variables <missing_vars>email</missing_vars> Missing <email> element or blank value is POSTed
428 Missing variables <missing_vars>template_id</missing_vars> Missing <template_id> element or blank value is POSTed
429 Invalid Template ID Value for <template_id> does not exist for your account.
436 Invalid email address The provided email address is not valid
437 Invalid Template Data The template data is not valid.
440 Unable to Send, Inactive Template The specified template is not active
441 Did Not Send: Error Saving Message There was a problem with creating the message from the data provided
444 Invalid binding value Binding is not assigned to the client
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.sendTest</methodName>

<email>jsmith@example.com</email>

<template_id>1055589</template_id>

<email_preference>plain</email_preference>

</methodCall>

Example Response

<methodResponse>

<item>

<methodName>transactional.sendTest</methodName>

<responseText>

<item>Template ID 1055589-test cache has been rebuilt</item>

<item>Sent Transaction</item>

</responseText>

<responseData>

<template_id>1055589</template_id>

<email>jsmith@example.com</email>

<contact_id>test</contact_id>

</responseData>

</item>

</methodResponse>


Back to API Reference Guide