MyCashflow includes the default email theme MyCashflow 2018, which can be modified and customized to suit your online store's needs.
The new default email theme is responsive, and its functionality has been thoroughly tested on various devices and email clients.
The default email theme can be selected at any time in version settings. However, by doing so, you select the system's internal default theme, whose source files aren't available via the online store's file directory.
In addition to the new email theme, the old and familiar chrome email theme (MyCashflow 2012) can be selected in any online store's version settings.
Downloading and customizing the default email theme
Requirements
Customizing the default email template is possible only if you have the git version-control system and the npm package manager installed on your computer.
You can use the MyCashflow 2018 email theme as a basis for your own email themes. The theme includes the Foundation for Emails tool, which makes further development much easier.
To download the email theme for your own use, open the terminal, go to the folder where you want to download the default email theme, and run the following commands:
git clone https://github.com/MyCashflow/Default-Email-Templates.git
cd Default-Email-Templates
npm install
The theme is now downloaded, initialized and ready for editing.
See also instructions for installing email themes.
Customizing the default theme
In the default email theme, you must run the build function to make changes to the theme come into effect. A build includes the following actions:
- Converting SASS styles to CSS language
- Converting Panini variables and Inky markup to HTML
A build is performed in the theme folder with the following command:
npm run build
After completing the build, you will see a preview of your email theme in your web browser. However, the preview does not process Interface tags, so email content is not printed on pages.
Once the build is complete, you can send the updated files to the online store's file directory.
Foundation for Emails
MyCashflow email templates use the Foundation for Emails framework that makes it possible to implement the structure and layout of emails in a variety of ways.
The Inky markup language
A significant difference compared to standard HTML templates is that the Foundation for Emails uses its own Inky template language to implement email templates. Thanks to Inky, there is no need for the designer to use <table>
elements; Foundation's own clear and easy-to-use elements can be used instead.
For example, the following markup creates a row divided into 2 columns with contents:
<container>
<row>
<columns>Contents 1</columns>
<columns>Contents 2</columns>
</row>
</container>
During a build, the above markup is converted into an HTML table with one row and two columns.
The Panini templating language
With the help of Foundation's Panini templating language, you can add variable content, conditional statements, loops, and other familiar programming structures to email files.
For example, our default email theme uses Panini to retrieve email templates' repeating sections such as headers and footers. Below you can see an example of how to retrieve sections to a page.
You can also add sections to emails as usual, i.e. by using MyCashflow's {Helper}
tag.
Panini also lets you create page variables where you can save the content printed by tags. Page variables are defined at the beginning of the template as follows:
---
subject: '{OrderEmailTitle}'
---
{{> header }}
<wrapper class="Primary">
<spacer size="10"></spacer>
<container class="Block">
<h1>{{ subject }}</h1>
<p>
{{> greeting }}
{OrderEmailMessage}
</p>
</container>
<spacer size="20"></spacer>
</wrapper>
Learn more about using Panini from Foundation's instructions
Using the mycashflow-sync tool in email themes
If you want to use the mycashflow-sync
tool with the default email theme, you'll need to run the build and sync in separate terminal windows.
Limitations
mycashflow-sync
does not convert the email theme's SASS files to CSS. The build
command handles the conversion of SASS styles.
Browsersync does not work with email themes.
Here's how to use the mycashflow-sync tool for synchronizing email templates: