- 3 Minutes to read
- Print
- DarkLight
transactional.testDesignPreview
- 3 Minutes to read
- Print
- DarkLight
General Information
This method enables an Everest Design Preview report to be requested for a specified transactional template. To use this method, your account must have the Everest Design Preview feature enabled.
If the specified template has any unpublished changes, this API method will publish the draft version of the template when making the Everest Design Preview report request. If the specified template has no unpublished changes, then this API will use the live version of the template for requesting the Design Preview report.
Best results for a transactional Design Preview rendering report are obtained when the template uses data representative of real recipients. Therefore, this API allows for sample .xml template data to be included with the API call via FTP or data URL.
Arguments
Field | Description | Field Type | Required | Example |
---|---|---|---|---|
template_id | The template identification number of the template to be tested. | 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 |
sample_data | Accepts either a <data_url> or FTP tags as child tags for <sample_data>. Any other child tag will be simply discarded and not treated as smarty content. | string | Yes | code, variable amounts |
{$smarty} variables | string | No | {order_id} | |
data_url | The URL of the data source located on the Internet. The allowable file extension is .xml only. | string | Conditional; required if not using FTP as the transfer protocol | https://www.mysite.com/data/content.xml |
ftp_server | IP address or hostname of your FTP server. | string | Conditional; required if file transfer is via FTP | ftp.mysite.com |
ftp_user_name | FTP username | string | Conditional; required if file transfer is via FTP | ftp_user |
ftp_user_pass | FTP password | string | Conditional; required if file transfer is via FTP | ftp_pass |
filename | Name of the data file on the FTP server (may include file path). The allowable file extension is .xml | string | Conditional; required if file transfer is via FTP | datafile.xml or /path/to_file/datafile.xml |
sftp | Indicator of whether the connection is via the sFTP protocol where:
| Boolean | No | 1 |
ftp_ssl | Indicator of whether FTP with a valid SSL certificate should be applied where:
| boolean | No | 1 |
Response
Field | Description | Example |
---|---|---|
template_id | The ID number of the template for which a Design Preview report is requested. | 1055589 |
Response Codes
responseCode | responseText | Description |
---|---|---|
209 | Transactional Design Preview test requested | Test transaction sent with Design Preview test requested |
401 | Invalid File type provided. Only the .xml file type is allowed. | Invalid File type provided. Only the .xml file type is allowed. |
402 | Data source not specified | If a malformed URL is passed in the data_url tag |
404 | URL for data file: is not found | The passed URL results in a "page not found" |
405 | Not all variables passed through | Missing any ftp tag or data file is not found on the FTP/SFTP site |
409 | Failed to download the file from: | Unable to connect to FTP/SFTP site to retrieve the data file |
428 | Missing variables | If any required tag is not provided in the API call |
429 | Invalid Template ID | The Template ID does not exist. |
437 | Invalid Template Data | The template data is not valid |
440 | Unable to Send, Inactive Template | The specified template is not active |
481 | No sample content available for the specified template | The template does not have stored/saved smarty replacement variable defaults defined |
490 | Everest account not provisioned | Did not send, Everest account not provisioned for this account |
491 | Inbox Rendering report feature not enabled | Did not send, Inbox Rendering feature not enabled for this account |
Example Post
<methodCall>
<methodName>transactional.testDesignPreview</methodName>
<template_id>2183050</template_id>
<email_preference>html</email_preference>
<sample_data>
<data_url>http://www.example.com/content.xml</data_url>
</sample_data>
</methodCall>
Example Response
<methodResponse>
<item>
<methodName>
<![CDATA[transactional.testdesignpreview]]>
</methodName>
<responseText>
<item>
<![CDATA[Template ID 2183050-test cache has been rebuilt.]]>
</item>
<item>
<![CDATA[Sent Transaction]]>
</item>
<item>
<![CDATA[Transactional Design Preview test requested]]>
</item>
</responseText>
<responseCode>
<item>
<![CDATA[203]]>
</item>
<item>
<![CDATA[201]]>
</item>
<item>
<![CDATA[209]]>
</item>
</responseCode>
<responseData>
<template_id>
<![CDATA[2183050]]>
</template_id>
<email>
<![CDATA[Inbox Preview Report]]>
</email>
<contact_id>
<![CDATA[test]]>
</contact_id>
</responseData>
<responseNum>
<![CDATA[1]]>
</responseNum>
</item>
</methodResponse>