email_templates

Description

This link relationship returns a collection of resources. You can easily paginate through this collection using the hypermedia links provided and the link relationships of first, prev, next, and last. Scroll down to view a representation of a single resource embedded within this collection.

Interact with this resource

To interact with this resource and see it in the context of the API, you can utilise Postman or your Terminal/Console to perform requests. If you have a Foxy store, you can also use the API browser in the admin to interact with resources connected to your store.

Actions

GET
View a list of email_templates
POST
Create a new email_template
HEAD
Get just the header response
OPTIONS
Get a response explaining which HTTP methods are supported

Example Representation

{
  "_links": {
    "curies": [
      {
        "name": "fx",
        "href": "https://api.foxycart.com/rels/{rel}",
        "templated": true
      }
    ],
    "self": {
      "href": "...",
      "title": "This Collection"
    },
    "first": {
      "href": "...?offset=0",
      "title": "First Page of this Collection"
    },
    "prev": {
      "href": "...?offset=0",
      "title": "Previous Page of this Collection"
    },
    "next": {
      "href": "...?offset=0",
      "title": "Next Page of this Collection"
    },
    "last": {
      "href": "...?offset=0",
      "title": "Last Page of this Collection"
    }
  },
  "_embedded": {
    "fx:email_templates": [...]
  },
  "total_items": "5",
  "returned_items": 5,
  "limit": 20,
  "offset": 0
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="...">
  <link rel="self" href="..." title="This Collection"/>
  <link rel="first" href="...?offset=0" title="First Page of this Collection"/>
  <link rel="prev" href="...?offset=0" title="Previous Page of this Collection"/>
  <link rel="next" href="...?offset=0" title="Next Page of this Collection"/>
  <link rel="last" href="...?offset=0" title="Last Page of this Collection"/>
  <resource href="..." rel="https://api.foxycart.com/rels/email_template">
  ...
  </resource>
  <total_items>5</total_items>
  <returned_items>5</returned_items>
  <limit>20</limit>
  <offset>0</offset>
</resource>
{
    "properties": {
        "total_items": "5",
        "returned_items": 5,
        "limit": 20,
        "offset": 0
    },
    "entities": [...],
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "..."
        },
        {
            "rel": [
                "first"
            ],
            "href": "...?offset=0"
        },
        {
            "rel": [
                "prev"
            ],
            "href": "...?offset=0"
        },
        {
            "rel": [
                "next"
            ],
            "href": "...?offset=0"
        },
        {
            "rel": [
                "last"
            ],
            "href": "...?offset=0"
        }
    ],
    "actions": [
    ]
}

Embedded Resource: email_template

Description

The Email Template contains the Twig content used to display the email receipt sent to your customers. We support both html and text emails, 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.

Interact with this resource

To interact with this resource and see it in the context of the API, you can utilise Postman or your Terminal/Console to perform requests. If you have a Foxy store, you can also use the API browser in the admin to interact with resources connected to your store.

Actions

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

Properties

Property Description Type Constraints
description The description of your email template. String Required. 100 characters or less. Defaults to Email Receipt Template.
subject The template text of your receipt email subject. String Optional
content_html 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. String Optional
content_html_url The URL of your html email template hosted on your own server online and publicly available for our server to cache. URL Optional. 300 characters or less.
content_text The content of your text email template. Leave blank to use the default template. You can set the content directly or set the content_url to point to your template content online and then POST to the cache link relationship. String Optional
content_text_url The URL of your text email template hosted on your own server online and publicly available for our server to cache. URL Optional. 300 characters or less.
template_language The language that the template should use. If this field is not passed it will default to nunjucks Must be one of the following: handlebars, nunjucks, pug, twig, ejs Optional
date_created The date this resource was created. Date Read only
date_modified The date this resource was last modified. Date Read only

Example Representation

{
    "_links": {
        "curies": [
            {
                "name": "fx",
                "href": "https://api.foxycart.com/rels/{rel}",
                "templated": true
            }
        ],
        "self": {
            "href": "https://api-sandbox.foxycart.com/email_templates/10",
            "title": "This Template"
        },
        "fx:store": {
            "href": "https://api-sandbox.foxycart.com/stores/8",
            "title": "This Store"
        },
        "fx:template_sets": {
            "href": "https://api-sandbox.foxycart.com/email_templates/10/template_sets",
            "title": "Template Sets using this template"
        },
        "fx:cache": {
            "href": "https://api-sandbox.foxycart.com/email_templates/10/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"
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="https://api-sandbox.foxycart.com/email_templates/10" rel="https://api.foxycart.com/rels/email_template">
  <link rel="self" href="https://api-sandbox.foxycart.com/email_templates/10" title="This Template"/>
  <link rel="https://api.foxycart.com/rels/store" href="https://api-sandbox.foxycart.com/stores/8" title="This Store"/>
  <link rel="https://api.foxycart.com/rels/template_sets" href="https://api-sandbox.foxycart.com/email_templates/10/template_sets" title="Template Sets using this template"/>
  <link rel="https://api.foxycart.com/rels/cache" href="https://api-sandbox.foxycart.com/email_templates/10/cache" title="POST here to cache your template using the content_html_url and content_text_url"/>
  <description>Email Receipt Template</description>
  <subject></subject>
  <content_html></content_html>
  <content_html_url></content_html_url>
  <content_text></content_text>
  <content_text_url></content_text_url>
  <date_created>2012-08-10T11:58:54-0700</date_created>
  <date_modified>2012-08-10T11:58:54-0700</date_modified>
</resource>
{
    "class": [
        "email_template"
    ],
    "properties": {
        "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"
    },
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "https://api-sandbox.foxycart.com/email_templates/10"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/store"
            ],
            "href": "https://api-sandbox.foxycart.com/stores/8"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/template_sets"
            ],
            "href": "https://api-sandbox.foxycart.com/email_templates/10/template_sets"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/cache"
            ],
            "href": "https://api-sandbox.foxycart.com/email_templates/10/cache"
        }
    ]
}

Zoomable Resources

This resource has no linked resources which can be "zoomed" in on, filtered and embedded within this resource.