Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Using Theme Settings in Email Notifications

Using Theme Settings in Email Notifications

agmsolutions
Shopify Partner
1 0 0

Hello!

 

For one of our clients, we are looking to customize the default email templates and have been trying to add some data from our settings_data.json file of our theme. This is easy using the Liquid syntax within the theme files, but we can't figure out how to access this data from the email templates. 

 

If you need more information, they use a variable called "header_message" to display a message at the top of each page of the site. They would like this on the Order Confirmation emails as it indicates when orders will be available each week.

 

I spoke to customer support and they ask the forums. Appreciate the help!

Replies 2 (2)

Visely-Team
Shopify Partner
1843 210 488

Unfortunately, you cannot use data from theme settings, but you can work it around using theme's locale files, which are available in notification temapltes. Under Shopify Code editor, open locales/en.default.json of the currently live theme (important), add a new key and make sure the key ends with _html, like this:

 

{
  "general": {
    "header_html": "<div>Our fancy header</div>"
  }
....

Then, in your notification template you can render its content using:

{{'general.header_html' | t}}
Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
rpbiwer
Shopify Partner
19 0 6

Brilliant! Thank you from 3 years into the future!