• Version: 1.2.0

Email Templates

Email templates allow you to create an email that will be automatically sent anytime an order is paid for or sent. You can link a page on your store (via the template slug) to a template contained in an HTML form or JSON file. The template itself can contain additional HTML-formatted text. To see an example of an email template, click here. Email templates have access to all order data fields as if the order was the top-level object.

The final email will be passed to the mail server specified in your settings. You can password-protect this URL using a secret code to prevent malicious users from sending faked emails.

You can see when an email is sent and what data is sent to an email template from the API here: List of email actions and the objects they return

All email template functions use the https://api.molt.in/v1/emails endpoint. Unlike most endpoints, email templates are referred to by slug, not ID number.

Email templates are flows-based structures with the following data fields by default:

Key Type Required Unique Details
id String No Yes Automatically populated when you create the email.
order Array No No Links to any orders related to this email.
created_at String No No Automatically populated when you create the email.
updated_at String No No Automatically populated when you modify the email.
slug String Yes Yes Included as part of the URL that triggers this email, as well as being the primary identifier in email template API calls.
name String Yes Yes A reference name for this template.
subject String Yes No The subject line for the emails that will be created using this template.
url String Yes No The address of the email template contents.
secret String No No A secret code to match against the template to prevent unauthorized access.
content_type String Yes No Whether the URL specifies a json array or an x-form-urlencoded page.
enabled Boolean Yes No Whether this email template can be used by the live site (1) or not (0).

Before you can use this (or any endpoint), you need to authenticate to get a bearer token.

This topic will cover the following processes:

Set Up Your Email Server

For email templates to send emails, you need to configure your SMTP server and email information settings. For this, you’ll need to send a PUT call to the settings endpoint. You can read in detail about the settings on the linked page, but in order to get emails to work correctly, you’ll need to set the following:

  • email_from_address
  • email_from_name
  • email_smtp_host
  • email_smtp_port
  • email_smtp_username
  • email_smtp_password
  • email_owner
  • email_encryption
curl -X POST https://api.molt.in/v1/settings \
	-H "Authorization: Bearer XXXX" \
	-d "email_from_address=person@example.com" \
	-d "email_from_name=Person Q. Smith" \
	-d "email_smtp_host=smtp.example.com" \
	-d "email_smtp_port=25" \
	-d "email_smtp_username=psmith" \
	-d "email_smtp_password=123456" \
	-d "email_owner=owner@example.com" \
	-d "email_encryption=none"

Create an Email Template

To create a new email template for your store, POST the required data to the https://api.molt.in/v1/emails endpoint. Every email that you create must have data for at least the fields marked Required in the table above. You can put data fields in any order. The URL specified does not need to exist at the time you create the template, but you will need to put something there if you want this template to create usable emails.

curl -X POST https://api.molt.in/v1/emails \
  -H "Authorization: Bearer XXXX" \
  -d "slug=order-complete" \
  -d "name=Completed Order" \
  -d "subject=Thank you for your purchase." \
  -d "url=http://www.example.com/tell-about/shipping-news" \
  -d "content_type=form" \
  -d "enabled=1"

A successful call will return a 201 Created HTML status code and the template information for the newly created template, including any default or generated values. The object it returns looks like this by default (the data will be different, of course):

{
  "status":true,
  "result":
  {
    "slug":"order-complete",
    "name":"Completed Order",
    "subject":"Thank you for your  purchase.",
    "url":"http:\/\/www.example.com\/tell-about\/shipping-news",
    "content_type":
    {
      "value":"application\/x-www-form-urlencoded",
      "data":
      {
        "key":"form",
        "value":"application\/x-www-form-urlencoded"
      }
    },
    "enabled":
    {
      "value":"Yes",
      "data":
      {
        "key":1,
        "value":"Yes"
      }
    },
    "id":"4d742504-8e4a-493a-aede-9559bb1c5faf"
  }
}

The actions below will return template information in this same format.

To create a new Email Hook in the forge

You may find it easier to create an email template using the forge interface. This will allow you to configure your SMTP gateway and create the template hook using forms.

To configure your SMTP gateway:

  1. Go to the Developer » Settings section of the forge or click here.
  2. Click the Email tab at the top right.
  3. Enter your email and server information. While you can leave some of the fields empty, we recommend that you complete all of the fields here to ensure that the store can send emails. For information on the fields here, please see the settings topic.

To create the email hook:

  1. Go to the Developer » Email Templates section of the forge or click here.
  2. Click the green Create Email Template button above the table.
  3. Complete the fields shown. These fields are explained at the top of this topic.

Like any other email template, an email will be created based on any order received.

Retrieve Email Template Information

Once you have created some email templates in your store, you have two methods to retrieve that information. The first requires that you know the slug of the template that you want, and it returns solely the information for that one email template. The second returns an array of email templates that you can specify a maximum number to return and offset the start of the array. Using these options, you can paginate results by increasing the offset of a search by the previous maximum.

Retrieve a Single Email Template by Slug

You can GET information for a single email template by adding the slug to the emails endpoint. No additional data fields are required.

curl -X GET https://api.molt.in/v1/emails/order-complete \
  -H "Authorization: Bearer XXXX"

A successful call returns a 200 OK status code and the email template information for the specified slug.

Retrieve a List of All Email Templates

Using the https://api.molt.in/v1/emails endpoint, you can return an array that contains all of the email templates that you have created.

curl -X GET https://api.molt.in/v1/emails \
  -H "Authorization: Bearer XXXX"

This will return 200 OK and an array of template information, as shown in the Create an Email Template section.

Edit an Email Template

To change one or more values in an email template, use a PUT call with the emails/{slug} endpoint. You can change most field values through this method, including enabling or disabling a template, updating the location, or changing subject lines.

curl -X PUT https://api.molt.in/v1/emails/order-complete \
  -H "Authorization: Bearer XXXX" \
  -d "subject=Still awaiting payment"

This will return 200 OK and the updated template information.

Delete a Single Email Template

To remove a template, use the same emails/{slug} endpoint we used to retrieve a single email template, except we use the DELETE request method. Note that this will not affect the contents of the template URL, just the information stored in the Moltin API.

curl -X DELETE https://api.molt.in/v1/emails/order-complete
	-H "Authorization: Bearer XXXX"

If successful, this call returns 200 OK and the following:

{
	"status":true,
	"message":"Email template removed successfully"
}

List of email actions and the objects they return

Our API fires off emails at specific points of the commerce cycle, we then use a specific naming convention to choose which email will be sent at that point, the supported events are as follows:

  • Slug: order_paid, event: When an order has been paid for
  • Slug: order_placed, event: When an order has been placed in the system
  • Slug: order_dispatched, event: When an order has been dispatched

When those events occur, we check your store to see if you have an email template with those event slugs. If you do, our API then begins the next step of sending that email.

order_paid

Returned object for email template:

{
    id: '1324539143040009099',
    order: null,
    created_at: '2016-08-25 09:29:51',
    updated_at: '2016-08-25 09:29:51',
    customer: {
        value: 'John Doe',
        data: {
            id: '1298031522829303836',
            order: null,
            created_at: '2016-07-19 19:43:57',
            updated_at: '2016-07-19 19:43:57',
            first_name: 'John',
            last_name: 'Doe',
            email: 'john@something.com',
            group: null,
            password: null
        }
    },
    gateway: {
        value: 'Stripe',
        data: {
            name: 'Stripe',
            slug: 'stripe',
            description: 'Credit cards',
            enabled: true
        }
    },
    status: {
        value: 'Paid',
        data: {
            key: 'paid',
            value: 'Paid'
        }
    },
    subtotal: 20.99,
    shipping_price: 3.95,
    total: 24.94,
    currency: {
        value: 'British Pound',
        data: {
            id: '1269465048959418529',
            code: 'GBP',
            title: 'British Pound',
            enabled: true,
            modifier: '+0',
            exchange_rate: 0,
            format: '£{price}',
            decimal_point: '.',
            thousand_point: ',',
            rounding: null,
            default: true,
            created_at: null,
            updated_at: null
        }
    },
    currency_code: 'GBP',
    exchange_rate: 0,
    shipping: {
        value: 'Standard delivery',
        data: {
            id: '1291467691722277348',
            order: null,
            created_at: '2016-07-10 18:22:47',
            updated_at: '2016-08-19 19:58:50',
            title: 'Standard delivery',
            slug: 'standard-delivery',
            company: 'Royal Mail',
            status: {
                value: 'Live',
                data: {
                    key: '1',
                    value: 'Live'
                }
            },
            price_min: 0,
            price_max: 0,
            weight_min: 0,
            weight_max: 0,
            tax_band: {
                value: 'Default',
                data: {
                    id: '1269465049018138661',
                    title: 'Default',
                    description: null,
                    rate: 0,
                    created_at: null,
                    updated_at: null
                }
            },
            description: 'Tracked (2-4 days)',
            price: {
                value: '£3.95',
                data: {
                    formatted: {
                        with_tax: '£3.95',
                        without_tax: '£3.95',
                        tax: '£0.00'
                    },
                    rounded: {
                        with_tax: 3.95,
                        without_tax: 3.95,
                        tax: 0
                    },
                    raw: {
                        with_tax: 3.95,
                        without_tax: 3.95,
                        tax: 0
                    }
                }
            }
        }
    },
    ship_to: {
        value: '',
        data: {
            id: '1298766161550246162',
            order: null,
            created_at: '2016-07-20 20:03:33',
            updated_at: '2016-07-20 20:03:33',
            save_as: '',
            first_name: 'John',
            last_name: 'Doe',
            address_1: '1 Road',
            address_2: '',
            postcode: 'something',
            country: {
                value: 'United Kingdom',
                data: {
                    code: 'GB',
                    name: 'United Kingdom'
                }
            },
            company: '',
            city: 'Newcastle',
            customer: {
                value: 'John Doe',
                data: {
                    id: '1298031522829303836',
                    order: null,
                    created_at: '2016-07-19 19:43:57',
                    updated_at: '2016-07-19 19:43:57',
                    first_name: 'John',
                    last_name: 'Doe',
                    email: 'john@something.com',
                    group: null,
                    password: null
                }
            },
            phone: '',
            county: 'Newcastle',
            instructions: '',
            email: ''
        }
    },
    bill_to: {
        value: '',
        data: {
            id: '1298766161550246162',
            order: null,
            created_at: '2016-07-20 20:03:33',
            updated_at: '2016-07-20 20:03:33',
            save_as: '',
            first_name: 'John',
            last_name: 'Doe',
            address_1: '1 Road',
            address_2: '',
            postcode: 'something',
            country: {
                value: 'United Kingdom',
                data: {
                    code: 'GB',
                    name: 'United Kingdom'
                }
            },
            company: '',
            city: 'Newcastle',
            customer: {
                value: 'Richard',
                data: {
                    id: '1298031522829303836',
                    order: null,
                    created_at: '2016-07-19 19:43:57',
                    updated_at: '2016-07-19 19:43:57',
                    first_name: 'John',
                    last_name: 'Doe',
                    email: 'john@something.com',
                    group: null,
                    password: null
                }
            },
            phone: '',
            county: 'Newcastle',
            instructions: '',
            email: ''
        }
    },
    totals: {
        formatted: {
            subtotal: '£20.99',
            total: '£24.94',
            shipping_price: '£3.95',
            tax: '£3.95'
        },
        rounded: {
            subtotal: 20.99,
            total: 24.94,
            shipping_price: 3.95,
            tax: 3.95
        },
        raw: {
            subtotal: 20.99,
            total: 24.94,
            shipping_price: 3.95,
            tax: 3.95
        }
    },
    count: 1,
    items: [{
        id: '1324539144508015500',
        created_at: '2016-08-25 09:29:52',
        updated_at: '2016-08-25 09:29:52',
        product: {
            value: 'Bag of cats',
            data: {
                id: '1302328300982501500',
                order: null,
                created_at: '2016-07-25 18:00:53',
                updated_at: '2016-08-25 09:15:18',
                sku: 'NEC2207',
                title: 'Bag of cats',
                slug: 'bag-of-cats',
                sale_price: 20.99,
                status: {
                    value: 'Live',
                    data: {
                        key: '1',
                        value: 'Live'
                    }
                },
                category: {
                    value: 'Clothing & Accessories',
                    data: {
                        '1269473434220364637': {
                            id: '1269473434220364637',
                            order: 1,
                            created_at: '2016-06-10 10:04:07',
                            updated_at: '2016-08-10 10:21:06',
                            parent: null,
                            slug: 'clothing-and-accessories',
                            status: {
                                value: 'Draft',
                                data: {
                                    key: '0',
                                    value: 'Draft'
                                }
                            },
                            title: 'Clothing & Accessories',
                            description: 'Clothing and accessories'
                        }
                    }
                },
                stock_level: 80,
                stock_status: {
                    value: 'In Stock',
                    data: {
                        key: '1',
                        value: 'In Stock'
                    }
                },
                description: '<p>A bag of cats</p>',
                requires_shipping: {
                    value: 'Yes',
                    data: {
                        key: '1',
                        value: 'Yes'
                    }
                },
                weight: 0,
                height: 0,
                width: 0,
                depth: 0,
                collection: {
                    value: 'Homepage features',
                    data: {
                        id: '1269506028928500581',
                        order: null,
                        created_at: '2016-06-10 11:08:53',
                        updated_at: '2016-06-10 11:08:53',
                        slug: 'homepage-features',
                        status: {
                            value: 'Live',
                            data: {
                                key: '1',
                                value: 'Live'
                            }
                        },
                        title: 'Homepage features',
                        description: 'Homepage features'
                    }
                },
                brand: null,
                tax_band: {
                    value: 'Default',
                    data: {
                        id: '1269465049018138661',
                        title: 'Default',
                        description: null,
                        rate: 0,
                        created_at: null,
                        updated_at: null
                    }
                },
                catalog_only: {
                    value: 'No',
                    data: {
                        key: '0',
                        value: 'No'
                    }
                },
                price: {
                    value: '£20.99',
                    data: {
                        formatted: {
                            with_tax: '£20.99',
                            without_tax: '£20.99',
                            tax: '£0.00'
                        },
                        rounded: {
                            with_tax: 20.99,
                            without_tax: 20.99,
                            tax: 0
                        },
                        raw: {
                            with_tax: 20.99,
                            without_tax: 20.99,
                            tax: 0
                        }
                    }
                },
                is_variation: false,
                modifiers: [],
                images: [{
                    id: 1302328550669419000,
                    name: 'bag-of-cats.jpg',
                    url: {
                        http: 'http://commercecdn.com/1265465041166401856/2b7f5691-1572-48b9-a86e-c99b692b16d4.jpeg',
                        https: 'https://commercecdn.com/1265465041166401856/2b7f5691-1572-48b9-a86e-c99b692b16d4.jpeg'
                    },
                    segments: {
                        domain: 'commercecdn.com/',
                        suffix: '1259465041166401856/2b7f5691-1572-48b9-a86e-c99b692b16d4.jpeg'
                    },
                    details: {
                        type: 'image',
                        size: 35755,
                        width: 400,
                        height: 400
                    }
                }]
            }
        },
        sku: 'NEC2207',
        title: 'Bag of cats',
        quantity: 1,
        tax_rate: 0,
        tax_band: {
            value: 'Default',
            data: {
                id: '1269465049018138661',
                title: 'Default',
                description: null,
                rate: 0,
                created_at: null,
                updated_at: null
            }
        },
        options: '[]',
        cart_identifier: '5e2833b2ec45dfe0aaf712c43d7d5a44',
        price: {
            value: '£20.99',
            data: {
                formatted: {
                    with_tax: '£20.99',
                    without_tax: '£20.99',
                    tax: '£0.00'
                },
                rounded: {
                    with_tax: 20.99,
                    without_tax: 20.99,
                    tax: 0
                },
                raw: {
                    with_tax: 20.99,
                    without_tax: 20.99,
                    tax: 0
                }
            }
        },
        totals: {
            value: '£20.99',
            data: {
                formatted: {
                    with_tax: '£20.99',
                    without_tax: '£20.99',
                    tax: '£0.00'
                },
                rounded: {
                    with_tax: 20.99,
                    without_tax: 20.99,
                    tax: 0
                },
                raw: {
                    with_tax: 20.99,
                    without_tax: 20.99,
                    tax: 0
                }
            }
        }
    }]
}

order_placed

Returned object for email template:

{
    id: '1319492786809995348',
    order: null,
    created_at: '2016-08-18 10:23:39',
    updated_at: '2016-08-18 10:23:39',
    customer: {
        value: 'John',
        data: {
            id: '1269609626911900535',
            order: null,
            created_at: '2016-06-10 14:34:43',
            updated_at: '2016-06-16 10:45:34',
            first_name: 'John',
            last_name: 'Doe',
            email: 'john@something.com',
            group: null,
            password: null
        }
    },
    gateway: {
        value: 'Stripe',
        data: {
            name: 'Stripe',
            slug: 'stripe',
            description: 'Card Payment',
            enabled: true
        }
    },
    status: {
        value: 'Paid',
        data: {
            key: 'paid',
            value: 'Paid'
        }
    },
    subtotal: 697,
    shipping_price: 6.99,
    total: 744.07,
    currency: {
        value: 'US Dollar',
        data: {
            id: '1261020823087480952',
            code: 'USD',
            title: 'US Dollar',
            enabled: true,
            modifier: '+0',
            exchange_rate: 0,
            format: '${price}',
            decimal_point: '.',
            thousand_point: ',',
            rounding: '99',
            default: true,
            created_at: null,
            updated_at: null
        }
    },
    currency_code: 'USD',
    exchange_rate: 0,
    shipping: {
        value: 'FedEx',
        data: {
            id: '1267603854887747919',
            order: null,
            created_at: '2016-06-07 20:09:36',
            updated_at: '2016-06-13 16:04:05',
            title: 'FedEx',
            slug: 'ohio-fedex',
            company: 'company name',
            status: {
                value: 'Live',
                data: {
                    key: '1',
                    value: 'Live'
                }
            },
            price_min: 0,
            price_max: 0,
            weight_min: 0,
            weight_max: 0,
            tax_band: {
                value: 'Ohio State',
                data: {
                    id: '1270900960310329388',
                    title: 'Ohio State',
                    description: 'Ohio state tax',
                    rate: 5.75,
                    created_at: null,
                    updated_at: null
                }
            },
            description: 'Ohio local shipping (FREE)',
            price: {
                value: '$6.99',
                data: {
                    formatted: {
                        with_tax: '$6.99',
                        without_tax: '$6.61',
                        tax: '$0.38'
                    },
                    rounded: {
                        with_tax: 6.99,
                        without_tax: 6.61,
                        tax: 0.38
                    },
                    raw: {
                        with_tax: 6.334425,
                        without_tax: 5.99,
                        tax: 0.344425
                    }
                }
            }
        }
    },
    ship_to: {
        value: '',
        data: {
            id: '1318771050909008730',
            order: null,
            created_at: '2016-08-17 10:29:41',
            updated_at: '2016-08-17 10:29:41',
            save_as: '',
            first_name: 'John',
            last_name: 'Doe',
            address_1: '1 Road',
            address_2: '',
            postcode: 'Something',
            country: {
                value: 'United States',
                data: {
                    code: 'US',
                    name: 'United States'
                }
            },
            company: '',
            city: 'San Francisco',
            customer: {
                value: 'John',
                data: {
                    id: '1269609626911900535',
                    order: null,
                    created_at: '2016-06-10 14:34:43',
                    updated_at: '2016-06-16 10:45:34',
                    first_name: 'John',
                    last_name: 'Doe',
                    email: 'john@something.com',
                    group: null,
                    password: null
                }
            },
            phone: '',
            county: 'Ohio',
            instructions: ''
        }
    },
    bill_to: {
        value: '',
        data: {
            id: '1318771050909008730',
            order: null,
            created_at: '2016-08-17 10:29:41',
            updated_at: '2016-08-17 10:29:41',
            save_as: '',
            first_name: 'John',
            last_name: 'Doe',
            address_1: '1 Road',
            address_2: '',
            postcode: 'Something',
            country: {
                value: 'United States',
                data: {
                    code: 'US',
                    name: 'United States'
                }
            },
            company: '',
            city: 'San Francisco',
            customer: {
                value: 'John',
                data: {
                    id: '1269609626911900535',
                    order: null,
                    created_at: '2016-06-10 14:34:43',
                    updated_at: '2016-06-16 10:45:34',
                    first_name: 'John',
                    last_name: 'Doe',
                    email: 'john@something.com',
                    group: null,
                    password: null
                }
            },
            phone: '',
            county: 'Ohio',
            instructions: ''
        }
    },
    totals: {
        formatted: {
            subtotal: '$263.99',
            total: '$744.07',
            shipping_price: '$6.99',
            tax: '$47.07'
        },
        rounded: {
            subtotal: 696.99,
            total: 744.99,
            shipping_price: 6.99,
            tax: 47.07
        },
        raw: {
            subtotal: 697,
            total: 744.07,
            shipping_price: 6.99,
            tax: 47.07
        }
    },
    count: 3,
    items: [{
        id: '1319492788168949845',
        created_at: '2016-08-18 10:23:39',
        updated_at: '2016-08-18 10:23:39',
        product: {
            value: 'Bag of cats',
            data: {
                id: '1261029518676590910',
                order: null,
                created_at: '2016-05-29 18:27:34',
                updated_at: '2016-08-17 11:03:18',
                sku: 'BB_PG_TP_GREEN',
                title: 'Bag of cats',
                slug: 'bag-of-cats',
                sale_price: 199,
                status: {
                    value: 'Live',
                    data: {
                        key: '1',
                        value: 'Live'
                    }
                },
                category: {
                    value: 'Packages',
                    data: {
                        '1258083895081959935': {
                            id: '1258083895081959935',
                            order: 1,
                            created_at: '2016-05-25 16:55:07',
                            updated_at: '2016-08-16 16:44:12',
                            parent: null,
                            slug: 'packages',
                            status: {
                                value: 'Draft',
                                data: {
                                    key: '0',
                                    value: 'Draft'
                                }
                            },
                            title: 'Packages',
                            description: 'Prepackaged products'
                        }
                    }
                },
                stock_level: 953,
                stock_status: {
                    value: 'In Stock',
                    data: {
                        key: '1',
                        value: 'In Stock'
                    }
                },
                description: 'A description',
                requires_shipping: {
                    value: 'Yes',
                    data: {
                        key: '1',
                        value: 'Yes'
                    }
                },
                weight: 0,
                height: 0,
                width: 0,
                depth: 0,
                catalog_only: {
                    value: 'No',
                    data: {
                        key: '0',
                        value: 'No'
                    }
                },
                tax_band: {
                    value: 'Ohio State',
                    data: {
                        id: '1270900960310329388',
                        title: 'Ohio State',
                        description: 'Ohio state tax',
                        rate: 5.75,
                        created_at: null,
                        updated_at: null
                    }
                },
                collection: null,
                brand: {
                    value: 'A Category',
                    data: {
                        id: '1261019156984103218',
                        order: null,
                        created_at: '2016-05-29 18:06:59',
                        updated_at: '2016-05-29 18:06:59',
                        slug: 'A Category',
                        status: {
                            value: 'Draft',
                            data: {
                                key: '0',
                                value: 'Draft'
                            }
                        },
                        title: 'A Category',
                        description: 'A Category'
                    }
                },
                price: {
                    value: '$263.99',
                    data: {
                        formatted: {
                            with_tax: '$263.99',
                            without_tax: '$249.64',
                            tax: '$14.35'
                        },
                        rounded: {
                            with_tax: 263.99,
                            without_tax: 249.64,
                            tax: 14.35
                        },
                        raw: {
                            with_tax: 263.9943,
                            without_tax: 249.64,
                            tax: 14.3543
                        }
                    }
                },
                is_variation: true,
                modifiers: {
                    '1261028112041247032': {
                        id: '1261028112041247032',
                        data: {
                            type: {
                                value: 'Variant',
                                data: {
                                    key: 'variant',
                                    value: 'Variant'
                                }
                            },
                            title: 'Color',
                            product: '1261027734855876919'
                        },
                        var_title: 'Green',
                        var_price: '+$0.00',
                        var_id: '1261028112041247032'
                    }
                },
                images: []
            }
        },
        sku: 'BB_PG_TP_GREEN',
        title: 'Bag of cats',
        quantity: 1,
        tax_rate: 5.75,
        tax_band: {
            value: 'Ohio State',
            data: {
                id: '1270900960310329388',
                title: 'Ohio State',
                description: 'Ohio state tax',
                rate: 5.75,
                created_at: null,
                updated_at: null
            }
        },
        options: {
            '1261028112041247032': '1261029513970581821'
        },
        cart_identifier: '20c01f3bec0c81553c8004878ce5406a',
        price: {
            value: '$263.99',
            data: {
                formatted: {
                    with_tax: '$263.99',
                    without_tax: '$249.64',
                    tax: '$14.35'
                },
                rounded: {
                    with_tax: 263.99,
                    without_tax: 249.64,
                    tax: 14.35
                },
                raw: {
                    with_tax: 263.9943,
                    without_tax: 249.64,
                    tax: 14.3543
                }
            }
        },
        totals: {
            value: '$263.99',
            data: {
                formatted: {
                    with_tax: '$263.99',
                    without_tax: '$249.64',
                    tax: '$14.35'
                },
                rounded: {
                    with_tax: 263.99,
                    without_tax: 249.64,
                    tax: 14.35
                },
                raw: {
                    with_tax: 263.9943,
                    without_tax: 249.64,
                    tax: 14.3543
                }
            }
        }
    }]
}

order_dispatched

Returned object for email template:

{
    id: '1320007150482752214',
    order: null,
    created_at: '2016-08-19 03:25:36',
    updated_at: '2016-08-23 17:21:23',
    customer: {
        value: 'John',
        data: {
            id: '1320005734972261076',
            order: null,
            created_at: '2016-08-19 03:22:47',
            updated_at: '2016-08-19 03:22:47',
            first_name: 'John',
            last_name: 'Doe',
            email: 'john@something.com',
            group: null,
            password: true
        }
    },
    gateway: {
        value: 'Authorize.Net AIM',
        data: {
            name: 'Authorize.Net AIM',
            slug: 'authorize-net-aim',
            description: null,
            enabled: true
        }
    },
    status: {
        value: 'Dispatched',
        data: {
            key: 'dispatched',
            value: 'Dispatched'
        }
    },
    subtotal: 57,
    shipping_price: 0,
    total: 57,
    currency: {
        value: 'United States Dollar',
        data: {
            id: '1284554191498379745',
            code: 'USD',
            title: 'United States Dollar',
            enabled: true,
            modifier: '++0',
            exchange_rate: 0,
            format: '${price}',
            decimal_point: '.',
            thousand_point: ',',
            rounding: null,
            default: true,
            created_at: null,
            updated_at: null
        }
    },
    currency_code: 'USD',
    exchange_rate: 0,
    shipping: {
        value: 'USPS - Free shipping',
        data: {
            id: '1299051862732833294',
            order: null,
            created_at: '2016-07-21 05:31:11',
            updated_at: '2016-07-21 06:21:14',
            title: 'USPS - Free shipping',
            slug: 'USPS-FREE',
            company: 'USPS',
            status: {
                value: 'Live',
                data: {
                    key: '1',
                    value: 'Live'
                }
            },
            price_min: 50,
            price_max: 0,
            weight_min: 0,
            weight_max: 0,
            tax_band: {
                value: 'Default',
                data: {
                    id: '1283612879664185625',
                    title: 'Default',
                    description: null,
                    rate: 0,
                    created_at: null,
                    updated_at: null
                }
            },
            description: 'Your cart total is over $50.00 so shipping is free.',
            price: {
                value: '$0.00',
                data: {
                    formatted: {
                        with_tax: '$0.00',
                        without_tax: '$0.00',
                        tax: '$0.00'
                    },
                    rounded: {
                        with_tax: 0,
                        without_tax: 0,
                        tax: 0
                    },
                    raw: {
                        with_tax: 0,
                        without_tax: 0,
                        tax: 0
                    }
                }
            }
        }
    },
    ship_to: {
        value: 'John R. Doe Home',
        data: {
            id: '1320007147613848277',
            order: null,
            created_at: '2016-08-19 03:25:35',
            updated_at: '2016-08-19 03:25:35',
            save_as: 'John R. Doe Home',
            first_name: 'John',
            last_name: 'Doe',
            address_1: '1 Road',
            address_2: 'undefined',
            postcode: 'something',
            country: {
                value: 'United States',
                data: {
                    code: 'US',
                    name: 'United States'
                }
            },
            company: '',
            city: 'Newcastle',
            customer: {
                value: 'John',
                data: {
                    id: '1320005734972261076',
                    order: null,
                    created_at: '2016-08-19 03:22:47',
                    updated_at: '2016-08-19 03:22:47',
                    first_name: 'John',
                    last_name: 'Doe',
                    email: 'john@something.com',
                    group: null,
                    password: true
                }
            },
            phone: '',
            county: 'OR',
            instructions: ''
        }
    },
    bill_to: {
        value: 'John R. Doe Home',
        data: {
            id: '1320007147613848277',
            order: null,
            created_at: '2016-08-19 03:25:35',
            updated_at: '2016-08-19 03:25:35',
            save_as: 'John R. Doe Home',
            first_name: 'John',
            last_name: 'Doe',
            address_1: '1 Road',
            address_2: 'undefined',
            postcode: 'something',
            country: {
                value: 'United States',
                data: {
                    code: 'US',
                    name: 'United States'
                }
            },
            company: '',
            city: 'Newcastle',
            customer: {
                value: 'John',
                data: {
                    id: '1320005734972261076',
                    order: null,
                    created_at: '2016-08-19 03:22:47',
                    updated_at: '2016-08-19 03:22:47',
                    first_name: 'John',
                    last_name: 'Doe',
                    email: 'john@something.com',
                    group: null,
                    password: true
                }
            },
            phone: '',
            county: 'OR',
            instructions: ''
        }
    },
    tracking_num: '9405511899563624465880',
    discount_amount: 0,
    totals: {
        formatted: {
            subtotal: '$57.00',
            total: '$57.00',
            shipping_price: '$0.00',
            tax: '$0.00'
        },
        rounded: {
            subtotal: 57,
            total: 57,
            shipping_price: 0,
            tax: 0
        },
        raw: {
            subtotal: 57,
            total: 57,
            shipping_price: 0,
            tax: 0
        }
    },
    count: 1,
    items: {
        data: [{
            id: '1320007152881894104',
            created_at: '2016-08-19 03:25:36',
            updated_at: '2016-08-19 03:25:36',
            product: {
                value: 'Bag of cats',
                data: {
                    id: '1294006554147685307',
                    order: null,
                    created_at: '2016-07-14 06:27:03',
                    updated_at: '2016-08-19 03:27:28',
                    sku: '897060002002',
                    title: 'Bag of cats',
                    slug: 'bag-of-cats',
                    sale_price: 0,
                    status: {
                        value: 'Live',
                        data: {
                            key: '1',
                            value: 'Live'
                        }
                    },
                    category: {
                        value: 'Cats',
                        data: {
                            '1293977335753606046': {
                                id: '1293977335753606046',
                                order: null,
                                created_at: '2016-07-14 05:29:00',
                                updated_at: '2016-07-14 05:29:30',
                                parent: null,
                                slug: 'trailbars',
                                status: {
                                    value: 'Live',
                                    data: {
                                        key: '1',
                                        value: 'Live'
                                    }
                                },
                                title: 'Cats',
                                description: ''
                            }
                        }
                    },
                    stock_level: 9981,
                    stock_status: {
                        value: 'In Stock',
                        data: {
                            key: '1',
                            value: 'In Stock'
                        }
                    },
                    description: '<p>A Bag of cuddly cats</p>',
                    requires_shipping: {
                        value: 'Yes',
                        data: {
                            key: '1',
                            value: 'Yes'
                        }
                    },
                    weight: 0,
                    height: 0,
                    width: 0,
                    depth: 0,
                    catalog_only: {
                        value: 'No',
                        data: {
                            key: '0',
                            value: 'No'
                        }
                    },
                    tax_band: {
                        value: 'Default',
                        data: {
                            id: '1283612879664185625',
                            title: 'Default',
                            description: null,
                            rate: 0,
                            created_at: null,
                            updated_at: null
                        }
                    },
                    collection: null,
                    brand: null,
                    price: {
                        value: '$28.50',
                        data: {
                            formatted: {
                                with_tax: '$28.50',
                                without_tax: '$28.50',
                                tax: '$0.00'
                            },
                            rounded: {
                                with_tax: 28.5,
                                without_tax: 28.5,
                                tax: 0
                            },
                            raw: {
                                with_tax: 28.5,
                                without_tax: 28.5,
                                tax: 0
                            }
                        }
                    },
                    is_variation: false,
                    modifiers: [],
                    images: [{
                        id: 1294715957310128400,
                        name: 'bag-of-cats.png',
                        url: {
                            http: 'http://commercecdn.com/1283312811842290111/872db3b4-30c8-42f6-98a3-df52c3e00f8e.png',
                            https: 'https://commercecdn.com/1233612811842290111/872db3b4-30c8-42f6-98a3-df52c3e00f8e.png'
                        },
                        segments: {
                            domain: 'commercecdn.com/',
                            suffix: '1283612811845290111/872db3b4-30c8-42f6-98a3-df52c3e00f8e.png'
                        },
                        details: {
                            type: 'image',
                            size: 47425,
                            width: 500,
                            height: 196
                        }
                    }]
                }
            },
            sku: '897060002002',
            title: 'Bag of cats',
            quantity: 1,
            tax_rate: 0,
            tax_band: {
                value: 'Default',
                data: {
                    id: '1283612879664185625',
                    title: 'Default',
                    description: null,
                    rate: 0,
                    created_at: null,
                    updated_at: null
                }
            },
            options: '[]',
            cart_identifier: '12e7d5007eb8826f11743db554c657f2',
            price: {
                value: '$28.50',
                data: {
                    formatted: {
                        with_tax: '$28.50',
                        without_tax: '$28.50',
                        tax: '$0.00'
                    },
                    rounded: {
                        with_tax: 28.5,
                        without_tax: 28.5,
                        tax: 0
                    },
                    raw: {
                        with_tax: 28.5,
                        without_tax: 28.5,
                        tax: 0
                    }
                }
            },
            totals: {
                value: '$28.50',
                data: {
                    formatted: {
                        with_tax: '$28.50',
                        without_tax: '$28.50',
                        tax: '$0.00'
                    },
                    rounded: {
                        with_tax: 28.5,
                        without_tax: 28.5,
                        tax: 0
                    },
                    raw: {
                        with_tax: 28.5,
                        without_tax: 28.5,
                        tax: 0
                    }
                }
            }
        }]
    }
}