email_template

Collection: email_templates

The Email Template contains the Twig content used to display the email receipt sent to your customers. Both html and text emails are supported, so you can provide content_html and content_text content. To use the default theme, leave the content_html and content_text properties empty. If you want to set your own template content, configure a content_html_url and/or content_text_url and then POST to the cache link relationship to cache your store's email template.

Required Scopes

Full store_full_access
Read templates_read
Write templates_write

Actions

GET View an email template
PATCH Update an email template (send only the properties you want to modify)
PUT Replace an email template (send the entire representation)
DELETE Delete an email template
HEAD Get just the header response
OPTIONS Get a response explaining which HTTP methods are supported

Properties (9)

description String

The description of your email template. Required. 100 characters or less. Defaults to Email Receipt Template.

subject String

The template text of your receipt email subject.

content_html String

The content of your html email template. Leave blank to use the default responsive template. You can set the content directly or set the content_html_url to point to your template content online and then POST to the cache link relationship.

content_html_url String

The URL of your html email template hosted on your own server online and publicly available for our server to cache. 300 characters or less.

content_text String

The content of your text email template. Leave blank to use the default template. You can set the content directly or set the content_text_url to point to your template content online and then POST to the cache link relationship.

content_text_url String

The URL of your text email template hosted on your own server online and publicly available for our server to cache. 300 characters or less.

template_language String

The language that the template should use. If this field is not passed it will default to nunjucks.

handlebarsnunjuckspugtwigejs
date_created String (nullable) · Read-only

The date this resource was created.

date_modified String (nullable) · Read-only

The date this resource was last modified.

Link Relations (4)

self This Template
fx:store GET PATCH PUT DELETE This Store
fx:template_sets GET POST Template Sets using this template
fx:cache POST here to cache your template using the content_html_url and content_text_url
https://api.foxycart.com/email_templates/{id}
Available via fx:email_template on template_set

Example Representation

{
  "_links": {
    "curies": [
      {
        "name": "fx",
        "href": "https://api.foxycart.com/rels/{rel}",
        "templated": true
      }
    ],
    "self": {
      "href": "https://api.foxycart.com/email_templates/123",
      "title": "This Template"
    },
    "fx:store": {
      "href": "https://api.foxycart.com/stores/456",
      "title": "This Store"
    },
    "fx:template_sets": {
      "href": "https://api.foxycart.com/email_templates/123/template_sets",
      "title": "Template Sets using this template"
    },
    "fx:cache": {
      "href": "https://api.foxycart.com/email_templates/123/cache",
      "title": "POST here to cache your template using the content_html_url and content_text_url"
    }
  },
  "description": "Email Receipt Template",
  "subject": "",
  "content_html": "",
  "content_html_url": "",
  "content_text": "",
  "content_text_url": "",
  "date_created": "2012-08-10T11:58:54-0700",
  "date_modified": "2012-08-10T11:58:54-0700"
}