General Idea
- A Mailster Template is a folder containing all individual Template Files and required assets.
- A Mailster Template can have multiple Template Files.
Structure
A Mailster Template includes at least two Template Files:
- index.html
- notification.html
You can add additional Template Files in this folder.
While the index.html file contains all available modules the notification.html file contains only a text area that is used for notifications (e.g. confirmation, new subscriber info, and emails used by WordPress with the wp_mail()
method.
Each Template File must include a header, similar to the header of a WordPress Theme:
<!--
Template Name: Your Template Name
Template URI: https://example.com
Description: Some short description of your template
Author: Your Name
Author URI: https://example.com
Version: 1.0
Width: XXX
-->
Name | Info |
---|---|
Template Name | The Name of your Template |
Name (optional) | The Name of your Template File |
Template URI (optional) | The URL of your template |
Description (optional) | A short description to describe your Template |
Author | The name of the creator |
Author URI (optional) | The URL of the creator |
Version | current version number |
Width (optional) | width of the template (Desktop) used for the module screenshots |
Each Template File is structured as follows:
- header
- modules
- module
- module
- …
- footer
The header
and footer
can also be inside the modules but only if a <module>
tag is wrapping the HTML.
Example HTML
Let’s take a look at this example
<!--
Template Name: Your Template Name
Template URI: https://example.com
Description: Some short description of your template
Author: Your Name
Author URI: https://example.com
Version: 1.0
Width: XXX
-->
<html>
<head>
<title>{subject}</title>
<style>
/* some styling here (will be inlined) */
</style>
<style data-embed>
/* some styling here (will NOT be inlined) */
</style>
</head>
<body>
<modules>
<module> </module>
<module> </module>
</modules>
</body>
</html>
Inlining CSS
Mailster will automatically inline all your CSS declared in any <style>
block in your document. You can prevent this by adding an embed-data
attributed to the <style>
tag:
<style data-embed>
/* CSS declarations will not by inlined */
</style>
Preheader
Preheader is used to display short info in the preview pane of the email client
To make preheaders work correctly you have to add a {preheader}
tag in your templates. Best is to wrap it in a div a hide it by default with CSS:
<div class="preheader">{preheader}</div>