include

Includes are reusable pieces of content (e.g. header or footer) that you can use throughout your templates and email campaigns.

The most common use of an include is to create a standard header or footer. The include API allows you to get, create/update, or delete an include. You can store content by any custom include name, and each include can contain html and/or plain text versions of content. 

Endpoint URL: https://api.sailthru.com/include


GET Mode

Examples

Get Include by Name

Example Call

Copy
{"include" : "global_footer"}

Example Response

Copy
{
    "name" : "global_footer",
    "content_html" : "<img src="https://example.com/vvlogo.png"><p>We thank you for your business.</p>",
    "content_text" : "VARICK & VANDAM | We thank you for your business."
}

Get All Include Names

Example Call

Copy
{}

Example Response

Copy
{
    "includes" : [
        {
            "name" : "global_header"        },
        {
            "name" : "global_footer"        }
        {
            "name" : "company_address"        }
    ]
}

Type Parameter Description
Optional Blank If your provide no parameters, all names return
Optional include If a name is provided, only returns that users with that unique indentifier
Return Blank If your provide no parameters, all names return
Return name An include's unique identifier/name
Return content_html The HTML within an include
Return content_text The rendered text within an include

POST Mode

Examples

Create Include with html and text versions of content

Example Call

Copy
{
    "include" : "global_footer",
    "content_html" : "<img src="https://example.com/vvlogo.png"><p>We thank you for your business.</p>",
    "content_text" : "VARICK & VANDAM | We thank you for your business."
}

Type Parameter Description
Required include Becomes the name of the include and is used for additional updates to the include.
Optional content_html The HTML within an include
Optional content_text The rendered text within an include