Editing Notifications
StoreHippo allows you to edit the content of the notifications and modify them as per your brand requirement.
Handlebars
StoreHippo uses Handlebars as the programming language for notifications. For more details, please refer
Simple Usage
Handlebars templates look like regular HTML, with embedded handlebars expressions. A handlebars expression is
<div class="entry">
<h1>{{title}}</h1>
<div class="body">
{{body}}
</div>
</div>
Handlers
Handlers allow you to execute some logic on the data. StoreHippo provides a number of built-in handlers in addition to the ones provided with Handlebars.
Built-in Handlers on StoreHippo
Currency
It is used to display the amount in the standard currency format. For order notifications, the currency used at the time of placing order is used, otherwise store's default currency is used.
Example
{{currency order.total}}
Date
It returns the format of the date.
Examples:
{{date order.created_on}}
{{date order.created_on 'dd/mm/yy'}}
You can show the date in six formats:
- dd-mm-yyyy: This will show up the date in "29-06-2015" format.
- dd/mm/yyyy: This will display the date in "29 JUN, 2015" format.
- dd/mm/yy: This date format will display the date in the "29 JUN, 2015 11:45:23 GMT+5:30" format.
- mm/dd/yy: This will display the date in "JUN 29 2015, 11:45:23 GMT+5:30" format.
- yy/mm/dd: This date format will display the date in the "2015 JUN 29, 11:45:23 GMT+5:30" format.
- dd-MMMM-yy: This date format will show up the date in "MON JUN 29 2015 11:45:23 GMT+5:30" format.
You can also display the date/Time in Indian Standard Timezone :
{{date created_on 'dd-MMMM-yy'}}
resolveStorePath
It returns the full CDN path of the image path.
Example
{{resolveStorePath product.images[0}.image}}
compare
It is used to check a particular condition.
Example
{{#compare order.total "1000" operator=">"}} {{/compare }}
language check for orders
It is used to check user had ordered in which language so you can modify your mail template accordignly by puttimg language check condition.
Example
{{#compare order.client_details.selected_language "AR" operator="=="}} arabic template {{/compare}}
resolveCdnPath
It returns the
Example
{{resolveCdnPath store.logo}}
Math Handlers
plus
How to add and show the sum of two numbers.
Example
{{plus order.total 1000}}
{{plus1 order.total 1000}}
minus
How to show the difference of two numbers
Example
{{minus order.total 1000}}
Words
Order total in words
Example
{{words order.total}}
Conditionals and Looping handlers
each
Iterate through items in an array
{{#each order.items}}
{{this.name}}
{{this.price}}
{{/each}}
Iterate through items of object
{{#each object}}
{{@key}}: {{this}}
{{/each}}
if
It is used to check if the value exists.
Example
{{#if order.items.length}} {{/if}}
Notifications in other languages
You can send notifications in different languages. You can put a language check condition to check in which language the user has ordered so you can modify your mail template accordingly. This will help you to send notifications to your customer in the language they have ordered.
Language specific invoice templates
You can customize the invoice templates by putting a language check condition to check in which language the user has ordered. You can modify your mail invoice template accordingly. This will help you to send invoices to your customers in the language they have placed the order.
