Class Mandrill_Templates
public
|
|
public
struct
|
#
add( string $name, string $from_email = null, string $from_name = null, string $subject = null, string $code = null, string $text = null, boolean $publish = true, array $labels = array() )
Add a new template Add a new template Parameters
Returnsstruct the information saved about the new template - slug string the immutable unique code name of the template - name string the name of the template - labels array the list of labels applied to the template - labels[] string a single label - code string the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version - subject string the subject line of the template, if provided - draft version - from_email string the default sender address for the template, if provided - draft version - from_name string the default sender from name for the template, if provided - draft version - text string the default text part of messages sent with the template, if provided - draft version - publish_name string the same as the template name - kept as a separate field for backwards compatibility - publish_code string the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published - publish_subject string the subject line of the template, if provided - publish_from_email string the default sender address for the template, if provided - publish_from_name string the default sender from name for the template, if provided - publish_text string the default text part of messages sent with the template, if provided - published_at string the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published - created_at string the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format - updated_at string the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format |
public
struct
|
#
info( string $name )
Get the information for an existing template Get the information for an existing template Parameters
Returnsstruct the requested template information - slug string the immutable unique code name of the template - name string the name of the template - labels array the list of labels applied to the template - labels[] string a single label - code string the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version - subject string the subject line of the template, if provided - draft version - from_email string the default sender address for the template, if provided - draft version - from_name string the default sender from name for the template, if provided - draft version - text string the default text part of messages sent with the template, if provided - draft version - publish_name string the same as the template name - kept as a separate field for backwards compatibility - publish_code string the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published - publish_subject string the subject line of the template, if provided - publish_from_email string the default sender address for the template, if provided - publish_from_name string the default sender from name for the template, if provided - publish_text string the default text part of messages sent with the template, if provided - published_at string the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published - created_at string the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format - updated_at string the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format |
public
struct
|
#
update( string $name, string $from_email = null, string $from_name = null, string $subject = null, string $code = null, string $text = null, boolean $publish = true, array $labels = null )
Update the code for an existing template. If null is provided for any fields, the values will remain unchanged. Update the code for an existing template. If null is provided for any fields, the values will remain unchanged. Parameters
Returnsstruct the template that was updated - slug string the immutable unique code name of the template - name string the name of the template - labels array the list of labels applied to the template - labels[] string a single label - code string the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version - subject string the subject line of the template, if provided - draft version - from_email string the default sender address for the template, if provided - draft version - from_name string the default sender from name for the template, if provided - draft version - text string the default text part of messages sent with the template, if provided - draft version - publish_name string the same as the template name - kept as a separate field for backwards compatibility - publish_code string the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published - publish_subject string the subject line of the template, if provided - publish_from_email string the default sender address for the template, if provided - publish_from_name string the default sender from name for the template, if provided - publish_text string the default text part of messages sent with the template, if provided - published_at string the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published - created_at string the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format - updated_at string the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format |
public
struct
|
#
publish( string $name )
Publish the content for the template. Any new messages sent using this template will start using the content that was previously in draft. Publish the content for the template. Any new messages sent using this template will start using the content that was previously in draft. Parameters
Returnsstruct the template that was published - slug string the immutable unique code name of the template - name string the name of the template - labels array the list of labels applied to the template - labels[] string a single label - code string the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version - subject string the subject line of the template, if provided - draft version - from_email string the default sender address for the template, if provided - draft version - from_name string the default sender from name for the template, if provided - draft version - text string the default text part of messages sent with the template, if provided - draft version - publish_name string the same as the template name - kept as a separate field for backwards compatibility - publish_code string the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published - publish_subject string the subject line of the template, if provided - publish_from_email string the default sender address for the template, if provided - publish_from_name string the default sender from name for the template, if provided - publish_text string the default text part of messages sent with the template, if provided - published_at string the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published - created_at string the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format - updated_at string the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format |
public
struct
|
#
delete( string $name )
Delete a template Delete a template Parameters
Returnsstruct the template that was deleted - slug string the immutable unique code name of the template - name string the name of the template - labels array the list of labels applied to the template - labels[] string a single label - code string the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version - subject string the subject line of the template, if provided - draft version - from_email string the default sender address for the template, if provided - draft version - from_name string the default sender from name for the template, if provided - draft version - text string the default text part of messages sent with the template, if provided - draft version - publish_name string the same as the template name - kept as a separate field for backwards compatibility - publish_code string the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published - publish_subject string the subject line of the template, if provided - publish_from_email string the default sender address for the template, if provided - publish_from_name string the default sender from name for the template, if provided - publish_text string the default text part of messages sent with the template, if provided - published_at string the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published - created_at string the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format - updated_at string the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format |
public
array
|
#
getList( string $label = null )
Return a list of all the templates available to this user Return a list of all the templates available to this user Parameters
Returnsarray an array of structs with information about each template - return[] struct the information on each template in the account - slug string the immutable unique code name of the template - name string the name of the template - labels array the list of labels applied to the template - labels[] string a single label - code string the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version - subject string the subject line of the template, if provided - draft version - from_email string the default sender address for the template, if provided - draft version - from_name string the default sender from name for the template, if provided - draft version - text string the default text part of messages sent with the template, if provided - draft version - publish_name string the same as the template name - kept as a separate field for backwards compatibility - publish_code string the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published - publish_subject string the subject line of the template, if provided - publish_from_email string the default sender address for the template, if provided - publish_from_name string the default sender from name for the template, if provided - publish_text string the default text part of messages sent with the template, if provided - published_at string the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published - created_at string the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format - updated_at string the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format |
public
array
|
#
timeSeries( string $name )
Return the recent history (hourly stats for the last 30 days) for a template Return the recent history (hourly stats for the last 30 days) for a template Parameters
Returnsarray the array of history information - return[] struct the stats for a single hour - time string the hour as a UTC date string in YYYY-MM-DD HH:MM:SS format - sent integer the number of emails that were sent during the hour - hard_bounces integer the number of emails that hard bounced during the hour - soft_bounces integer the number of emails that soft bounced during the hour - rejects integer the number of emails that were rejected during the hour - complaints integer the number of spam complaints received during the hour - opens integer the number of emails opened during the hour - unique_opens integer the number of unique opens generated by messages sent during the hour - clicks integer the number of tracked URLs clicked during the hour - unique_clicks integer the number of unique clicks generated by messages sent during the hour |
public
struct
|
#
render( string $template_name, array $template_content, array $merge_vars = null )
Inject content and optionally merge fields into a template, returning the HTML that results Inject content and optionally merge fields into a template, returning the HTML that results Parameters
Returnsstruct the result of rendering the given template with the content and merge field values injected - html string the rendered HTML as a string |