Thanks for being patient while we implement your feedback to improve the developer experience.

Email Templates

Manage Handlebars-based email templates globally and create channel-specific overrides.

Get Email Templates

GET /marketing/email-templates

Request

Get a list of email templates.

Note

The /marketing/email-templates endpoints only work after opting into the new email management experience from your storeʼs control panel. You can opt-in by visiting Email Templates. If you have already opted in, visiting the Email Templates page will return a 404 error, and you will be able to access the new Transactional Emails page.

Authentication

  • X-Auth-Token in header - required

Parameters

  • store_hash in path - string
  • channel_id in query - integer

    Channel ID to use for channel-specific setting. If omitted, you will interact with the global setting only.

example

curl --request GET \ --url 'https://api.bigcommerce.com/stores/[store_hash]/v3/marketing/email-templates' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx'

Response

An array of email templates on the store

Body

object | application/json
  • data
    array[object]

    A collection of all email templates.

  • meta
    object

    Response metadata.

Example

{ "data": [ { "type_id": "account_reset_password_email", "body": "<!DOCTYPE html> <html lang=\"en\"> <head> <meta charset=\"UTF-8\"> <title>Title</title> </head> <body> <p> {{lang \"reset_password\" name=store.name}} </p> <br/> <br/> <a href=\"{{account.reset_password_link}}\"> {{account.reset_password_link}} </a> </body> </html>", "translations": [ { "locale": "en", "keys": { "reset_password": "To change your customer account password at {{name}} please click this link or copy and paste it into your browser:" } } ], "subject": "Reset your password at {{store.name}}" } ], "meta": {} }

Get an Email Template

GET /marketing/email-templates/{template-name}

Request

Get a single global email template or a channel-specific email template override.

Note

The /marketing/email-templates endpoints only work after opting into the new email management experience from your storeʼs control panel. You can opt-in by visiting Email Templates. If you have already opted in, visiting the Email Templates page will return a 404 error, and you will be able to access the new Transactional Emails page.

Authentication

  • X-Auth-Token in header - required

Parameters

  • store_hash in path - string
  • template-name in path - string - required
  • channel_id in query - integer

    Channel ID to use for channel-specific setting. If omitted, you will interact with the global setting only.

example

curl --request GET \ --url 'https://api.bigcommerce.com/stores/[store_hash]/v3/marketing/email-templates/[template-name]' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx'

Response

OK

Body

object | application/json
  • data
    object

    Data for a particular email template

  • meta
    object

    Response metadata.

Example

{ "data": { "type_id": "account_reset_password_email", "body": "<!DOCTYPE html> <html lang=\"en\"> <head> <meta charset=\"UTF-8\"> <title>Title</title> </head> <body> <p> {{lang \"reset_password\" name=store.name}} </p> <br/> <br/> <a href=\"{{account.reset_password_link}}\"> {{account.reset_password_link}} </a> </body> </html>", "translations": [ { "locale": "en", "keys": { "reset_password": "To change your customer account password at {{name}} please click this link or copy and paste it into your browser:" } } ], "subject": "Reset your password at {{store.name}}" }, "meta": {} }

Update a Template

PUT /marketing/email-templates/{template-name}

Request

Update a global template or create a channel-specific email template override.

Authentication

  • X-Auth-Token in header - required

Parameters

  • store_hash in path - string
  • template-name in path - string - required
  • Content-Type in header with default of application/json - string - required

    The MIME type of the request body.

  • channel_id in query - integer

    Channel ID to use for channel-specific setting. If omitted, you will interact with the global setting only.

Body

object | application/json

Data for a particular email template

  • type_id
    string

    Allowed: abandoned_cart_email | account_details_changed_email | combined_order_status_email | createaccount_email | createguestaccount_email | giftcertificate_email | invoice_email | ordermessage_notification | return_confirmation_email | return_statuschange_email | product_review_email | account_reset_password_email

    Example: account_reset_password_email

  • body
    string

    Example: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <p> {{lang "reset_password" name=store.name}} </p> <br/> <br/> <a href="{{account.reset_password_link}}"> {{account.reset_password_link}} </a> </body> </html>

  • translations
    array[object]

    A collection of locale translations for the static language.

  • subject
    string

    Example: Reset your password at {{store.name}}

Example

{ "type_id": "account_reset_password_email", "body": "<!DOCTYPE html> <html lang=\"en\"> <head> <meta charset=\"UTF-8\"> <title>Title</title> </head> <body> <p> {{lang \"reset_password\" name=store.name}} </p> <br/> <br/> <a href=\"{{account.reset_password_link}}\"> {{account.reset_password_link}} </a> </body> </html>", "translations": [ { "locale": "en", "keys": { "reset_password": "To change your customer account password at {{name}} please click this link or copy and paste it into your browser:" } } ], "subject": "Reset your password at {{store.name}}" }

Response

OK

Body

object | application/json
  • data
    object

    Data for a particular email template

  • meta
    object

    Response metadata.

Example

{ "data": { "type_id": "account_reset_password_email", "body": "<!DOCTYPE html> <html lang=\"en\"> <head> <meta charset=\"UTF-8\"> <title>Title</title> </head> <body> <p> {{lang \"reset_password\" name=store.name}} </p> <br/> <br/> <a href=\"{{account.reset_password_link}}\"> {{account.reset_password_link}} </a> </body> </html>", "translations": [ { "locale": "en", "keys": { "reset_password": "To change your customer account password at {{name}} please click this link or copy and paste it into your browser:" } } ], "subject": "Reset your password at {{store.name}}" }, "meta": {} }

Delete Email Template Override

DELETE /marketing/email-templates/{template-name}

Request

Removes a channel-specific email template override.

Authentication

  • X-Auth-Token in header - required

Parameters

  • store_hash in path - string
  • template-name in path - string - required
  • channel_id in query - integer - required

    Required Channel ID. This delete operation will delete overridden settings for this channel, thus restoring them to the global defaults.

example

curl --request DELETE \ --url 'https://api.bigcommerce.com/stores/[store_hash]/v3/marketing/email-templates/[template-name]' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx'

Response

OK