Email Templates
Manage Handlebars-based email templates globally and create channel-specific overrides.
Get Email Templates
GET https://api.bigcommerce.com/stores/{store_hash}/v3/marketing/email-templatesRequest
Get a list of email templates.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- channel_id in query - integerChannel ID to use for channel-specific settings. 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: {{token}}'
Response
An array of email templates on the store
Body
object | application/json
dataarray[object]
A collection of all email templates.
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 https://api.bigcommerce.com/stores/{store_hash}/v3/marketing/email-templates/{template-name}Request
Get a single global email template or a channel-specific email template override.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- template-name in path - stringrequired
- channel_id in query - integerChannel ID to use for channel-specific settings. 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: {{token}}'
Response
OK
Body
object | application/json
dataobject
Data for a particular email template
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 https://api.bigcommerce.com/stores/{store_hash}/v3/marketing/email-templates/{template-name}Request
Update a global template or create a channel-specific email template override.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- template-name in path - stringrequired
- Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
- channel_id in query - integerChannel ID to use for channel-specific settings. If omitted, you will interact with the global setting only.
Body
object | application/json
Data for a particular email template
type_idstring
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_emailbodystring
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>translationsarray[object]
A collection of locale translations for the static language.subjectstring
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
dataobject
Data for a particular email template
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 https://api.bigcommerce.com/stores/{store_hash}/v3/marketing/email-templates/{template-name}Request
Removes a channel-specific email template override.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- template-name in path - stringrequired
- channel_id in query - integerrequiredRequired 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: {{token}}'
Response
OK
See something you can improve? Edit this file on GitHub
Did you find what you were looking for?