Campaign Templates API

Create a new template

URL

POST /ga/api/v2/mailing_lists/:mailing_list_id/templates

Request Parameters

The POST request should have a JSON document in its payload with at least keys
that marked with bold in the following list:

name
string
The name of the template
mailing_list_id
integer
The id of the mailing list the template belongs to
mailing_list_name
string
The name of the mailing list the template belongs to
segmentation_criteria_id
integer
The id of the segmentation criteria used by this template
contents
array of hashes

id
integer
The ID for this content record.
name
string
String identifier for this content.
subject
string
The subject of the email.
format
string
Email format to use when delivering this campaign. Valid formats include html, text, and both.
html
string
If format is html or both, this is the HTML portion of the email.
text
string
If format is text or both, this is the plaintext portion of the email.
dispatch_attributes
array of hashes
Inline object containing delivery settings of the Template;
Comes from the server only if delivery settings of the Template are defined.

state
string
The state of delivery;
Can be one of: idle, scheduled, sending, finished, failed, cancelled.
virtual_mta_id
integer
The id of a Virtual MTA explicitly assigned to the Template; Will come blank if Template is about to use general setting
virtual_mta_name
string
The name of a Virtual MTA explicitly assigned to the Template
bounce_email_id
string
The id of a Bounce Email explicitly assigned to the Template; Will come blank if Template is about to use general setting
bounce_email_name
string
The Bounce Email explicitly assigned to the Template
url_domain_id
integer
The id of an URL domain explicitly assigned to the Template
url_domain_name
string
The URL domain explicitly assigned to the Template
seed_list_id
integer
The id of a Seed List assigned to the Template
seed_list_name
string
The name of the Seed List assigned to the Template
speed
integer
Maximum throughput speed; 0 for unlimited throughput
track_opens
boolean
Marks whether the Template will track openings stats
track_links
boolean
Marks whether the Template will track clicks stats
paused
boolean
Marks whether the Template has been paused
from_name
string
Name to use in the From field
from_email
string
Email to use in the From field
reply_to
string
Email to use in the Reply-To header
begins_at
string
Time to start delivery at
started_at
string
Time when delivery actually started
autowinner_enabled
boolean
The template is configured to use automatic winner selection.
autowinner_percentage
string
The percentage that will be sent for the split-test portion of the template.

This value is returned as a string to prevent floating-point conversion errors.
You may send this value as an Integer, Float or String. Posting a value with
more than 2 decimals will cause a validation error. Be careful because IEEE
floating point can not exactly represent some decimal values. For example
94.85 is represented as
94.85000000000001 which will cause a
validation error if used here. You may want to print to a string using two
decimals of precision.

autowinner_delay_amount
integer
The number of units of time that the template will wait before finishing after a split-test.
autowinner_delay_unit
string
The unit used in calculating the delay duration.
autowinner_metric
string
The metric used to decide the winner. See the “Automatic Winner Selection Metrics” table for more information.

Response

A successful response will return the template record using the format
described above.