Template.Create

Creates a new template for a client.

Parameters and required information

Here’s a list of all the parameters you’ll need to pass to the Template.Create method. All of the parameters are required unless otherwise noted.

ApiKey
Your API application key. See here for more details.

ClientID
The ID of the client for whom the template should be created. See here for more details.

TemplateName
The name of the template. Maximum of 30 characters (will be truncated to 30 characters if longer).

HTMLPageURL
The URL of the HTML page you have created for the template.

ZipFileURL
Optional URL of a zip file containing any other files required by the template.

ScreenshotURL
Optional URL of a screenshot of the template. Must be in jpeg format and at least 218 pixels wide.

Return Codes

Success

Upon a successful call, this method will return a string containing the TemplateID of the newly created template.

Error

100: Invalid API Key
The API key passed was not valid or has expired.

102: Invalid ClientID
The ClientID value passed in was not valid.

4002: Template Name Required
The template name passed cannot be empty.

4003: Invalid Template Name
The template name entered is invalid.

4004: HTML Page URL Required
The URL to your HTML page for the template cannot be empty.

4005: Invalid HTML Page URL
You must provide a valid URL to your HTML page for the template.

4006: Invalid ZIP File URL
The URL of the zip file you have passed is invalid.

4007: Invalid Screenshot URL
The URL of the screenshot file you have passed is invalid.

4101: No Description Or Repeater
You need to have either a <$title$> or <$description$> tag in your template. Without either of these, your clients can’t add any content to their emails.

4102: No Closing Repeater
We found your <repeater> tag, but we couldn’t track down the </repeater> tag. Please add it to close the loop.

4103: No Width Specified in the Image Tag
The image you’ve added as <image> needs a width added so we can resize all the images your client adds to be the same width as this image (height is not required).

4104: No Title Description or Image in a Repeater Tag
We found your <repeater> and </repeater> tags, but couldn’t track down a <$title$>, <$description$> or <$image$> tag. Your clients will need one of these tags so they can add content to their repeating items.

4108: No Closing Table of Contents
We found the <tableofcontents> tag, but couldn’t track down the </tableofcontents> tag. You’ll need to add this before the table of contents will work.

4109: No repeatertitle Tag
We found your <tableofcontents> and </tableOfContents> tags, but couldn’t track down the <$repeatertitle$> tag.

4110: repeatertitle Tag Without Open tableofcontents Tag
We found the table of contents repeater title tag, but not the table of contents tags themselves. You need to also add the <tableofcontents> and </tableofcontents> tags around your <$repeatertitle$> tag.

4111: repeatertitle Tag Without Open or Close tableofcontents Tag
We found the table of contents repeater title tag, but not the table of contents tags themselves. You need to also add the <tableofcontents> and </tableofcontents> tags around your <$repeatertitle$> tag.

4118: Table of Contents With No Repeater Tag
If you’re adding table of contents, you’ll also need a repeater in your template. The table of contents is automatically created based on what your client adds for each repeater title. If you have a table of contents, you’ll need to also add the <repeater> and </repeater> and associated tags to your template.

4120: Repeater Contains More Than One Title Tag
We found multiple instances of the title tag inside your repeater open and close tags. In order to work correctly, your campaign can only define one title tag within the <repeater> tags.

4121: Repeater Contains More Than One Description Tag
We found multiple instances of the description tag inside your repeater open and close tags. In order to work correctly, your campaign can only define one description tag within the <repeater> tags.

4123: Contains Multiple Repeater Tags
We found multiple instances of the image tag inside your repeater open and close tags. In order to work correctly, your campaign can only define one image tag within the <repeater> tags.

4124: Non Repeater Image No Width
You didn’t specify a width for your non-repeater image. The image you’ve added needs a width attribute so we can resize the image your client adds to be the same width as this image (height is not required).

4125: Link In Unsubscribe Tags
You aren’t allowed to specify a link in between your <unsubscribe> and </unsubscribe> tags. This causes the personalized unsubscribe link we generate to become invalid.

4126: Closing Repeater Tag Found Before The Open Repeater Tag
We found an occurrence of the </repeater> tag before the open repeater tag (<repeater>).

4127: Multiple Toc True Repeaters
There are multiple repeaters with the toc attribute set to \”true\”. Only one of your repeaters can populate the table of contents.

4128: Nested Repeaters
Your template contains a repeater tag within an open repeater, or nested repeaters. Repeaters cannot be nested and must be separate of other repeaters in your template.

4129: Table Based Repeater Contains Multiple Trs
A repeater in your template contains multiple <tr> tags, click here for information about how to fix this.

4201: Contains Flash
Flash is not supported by almost every email client out there and should not be included in your emails. For more details on flash support, check out this article.

4202: Contains Script
Almost every popular email client and spam filter does not support JavaScript. Your campaign will either be filtered as spam, or will display a security warning to your recipients. We recommend removing all JavaScript code from your campaign and then re-import it.

4203: Contains Java
Java is not supported by almost every email client out there and should not be included in your emails. Please remove it from your template.

4300: No Unsubscribe Tag
We require a single-click unsubscribe link in every campaign you send. To add an unsubscribe link, you can… Do it yourself - by adding the tags <unsubscribe> and </unsubscribe> around the words you want to become an unsubscribe link, and then re-import your template.

4301: Unsubscribe Tag Hidden In Comments
Your unsubscribe tag appears to be hidden inside HTML comment tags such as <!— —> . Please ensure your unsubscribe link is visible and not commented out of the page.

4302: Unsubscribe Tag Contains Less Than 3 Characters
You’ll need to add some text, such as ‘unsubscribe’ in between your<unsubscribe> and </unsubscribe> tags. Those words will then become an unsubscribe link for each recipient.

4303: Unsubscribe Tag Contains A Link
It appears your unsubscribe tag contains a link. Please ensure you add the tags <unsubscribe> and </unsubscribe> around only the words (and not links) you want to become an unsubscribe link. We’ll automatically convert that to a link for each recipient.

4304: No Closing Unsubscribe Tag
We found the <unsubscribe> tag, but couldn’t track down the </unsubscribe> tag. You’ll need to add this before the unsubscribe link will work.

4350: Files Missing from ZIP File
It appears that there are files missing from your zip file which are referenced by your HTML file. Please ensure that all necessary files are included in the zip file and that the HTML file references all other files correctly.

SOAP 1.1

The following is a sample SOAP request and response. The placeholders shown need to be replaced with actual values.

POST /api/api.asmx HTTP/1.1
Host: api.createsend.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://api.createsend.com/api/Template.Create"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Template.Create xmlns="http://api.createsend.com/api/">
      <ApiKey>string</ApiKey>
      <ClientID>string</ClientID>
      <TemplateName>string</TemplateName>
      <HTMLPageURL>string</HTMLPageURL>
      <ZipFileURL>string</ZipFileURL>
      <ScreenshotURL>string</ScreenshotURL>
    </Template.Create>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <Template.CreateResponse xmlns="http://api.createsend.com/api/">
      <Template.CreateResult>string</Template.CreateResult>
    </Template.CreateResponse>
  </soap12:Body>
</soap12:Envelope>

HTTP GET

The following is a sample HTTP GET request and response. The placeholders shown need to be replaced with actual values.

GET /api/api.asmx/Template.Create?ApiKey=string&ClientID=string&TemplateName=string&HTMLPageURL=string&ZipFileURL=string&ScreenshotURL=string HTTP/1.1
Host: api.createsend.com
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://api.createsend.com/api/">string</string>

HTTP POST

The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.

POST /api/api.asmx/Template.Create HTTP/1.1
Host: api.createsend.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

ApiKey=string&ClientID=string&TemplateName=string&HTMLPageURL=string&ZipFileURL=string&ScreenshotURL=string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://api.createsend.com/api/">string</string>