.. _mail_templates: ############## Mail templates ############## With mail templates you can manage your email texts for reusability with different notification rules. Edit it once and the changes will take effect on all rules which are using the template. Mail templates additionally allow you to create HTML emails. .. image:: _static/mail_tpl_index.jpg :height: 348px :width: 645px :scale: 100% :alt: Mail templates index page ************************** Create a new mail template ************************** Click the link "Create new mail template" on the mail templates index page and the page for editing mail templates will open. .. image:: _static/mail_tpl_create.jpg :height: 775px :width: 627px :scale: 100% :alt: Create a new mail template Choose a name for your new mail template and insert it in the text field "Name". This will work as an internal identifier for selecting this mail template in the rules form. If you do not change the setting for "Mail type" it will be a plain text email. Enter your notification text in the textbox "Mail body". All placeholders are supported. To see a list of all available placeholders, click the link "List of placeholders" in the right sidebar (or open the manual page :ref:`placeholders`). For plain text mail templates you do not need to insert an alternative body. .. _mail_templates_html: HTML mails ~~~~~~~~~~ If you want to create a new HTML mail template, click the radio button "HTML" for "Mail type". The text box for mail body will automatically change to **WYSIWIG style editor**. By default the editor will load in the source code view where you can insert or copy/paste your HTML code. .. image:: _static/form_html_mail_editor.jpg :height: 448px :width: 744px :scale: 100% :alt: Source editor To switch to the WYSIWIG view, click the "Source" button in the editor's toolsbar. .. image:: _static/form_html_mail_editor2.jpg :height: 484px :width: 745px :scale: 100% :alt: WYSIWIG editor If you want to send notification mail in HTML format, remember to add an alternative body text. This text will be displayed in email clients which are not capable of loading HTML mails. When your template is done, click the button "Add template". You will be forwarded to the mail templates overview page and your newly created template will show up in the list. .. image:: _static/themeforest_banner.jpg :height: 125px :width: 125px :scale: 100% :target: http://themeforest.net/category/marketing/email-templates/?ref=ifeelweb If you are looking for professionally designed HTML mail layouts, you will surely find the right one for you on `Envato's themeforest `_. **************************** Managing your mail templates **************************** .. image:: _static/mail_tpl_index2.jpg :height: 210px :width: 517px :scale: 100% :alt: Mail templates list In the mail templates overview page you can hover a mail template entry to see the links for managing a template. **"Edit"** will bring you back to the editor page where you can adjust your mail texts. If you want to create a new template based on the layout of an already existing template, you can **copy** the original template and then edit the duplicate. For template exchange or backup, **"Export"** is the perfect choice. Either click the "Export" link in a row to export only the hovered template or use the checkboxes to select multiple templates and then select "Export" from the "Bulk Actions". ************************* Using your mail templates ************************* After you have created a mail template, it will show up in the notification rule form's "Mail template" drop down. If you choose your mail template, the default text box will disappear, because the text of the mail tempalte will be used. .. image:: _static/mail_tpl_rules.jpg :height: 195px :width: 497px :scale: 100% :alt: Rules form mail template selection