PHPackages                             lekoala/silverstripe-email-templates - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. lekoala/silverstripe-email-templates

ActiveSilverstripe-vendormodule[Mail &amp; Notifications](/categories/mail)

lekoala/silverstripe-email-templates
====================================

Adds email-templates in the SilverStripe CMS

2.2.4(3y ago)43.1k7[1 issues](https://github.com/lekoala/silverstripe-email-templates/issues)MITPHPPHP &gt;=7CI failing

Since Jun 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/lekoala/silverstripe-email-templates)[ Packagist](https://packagist.org/packages/lekoala/silverstripe-email-templates)[ RSS](/packages/lekoala-silverstripe-email-templates/feed)WikiDiscussions master Synced yesterday

READMEChangelog (9)Dependencies (5)Versions (13)Used By (0)

SilverStripe Email Templates module
===================================

[](#silverstripe-email-templates-module)

[![Build Status](https://github.com/lekoala/silverstripe-email-templates/actions/workflows/ci.yml/badge.svg)](https://github.com/lekoala/silverstripe-email-templates/actions/workflows/ci.yml/badge.svg)[![scrutinizer](https://camo.githubusercontent.com/44ba50239fef6ee9b9779432b983e74a35fe729f8d4239a564a76502dee40f09/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c656b6f616c612f73696c7665727374726970652d656d61696c2d74656d706c617465732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/lekoala/silverstripe-email-templates/)[![Code coverage](https://camo.githubusercontent.com/9076dc3cb5bce2d6bac61bab5e6c9e52fc15ccbeb5891f1db8a6ee968206708d/68747470733a2f2f636f6465636f762e696f2f67682f6c656b6f616c612f73696c7665727374726970652d656d61696c2d74656d706c617465732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/lekoala/silverstripe-email-templates)

This module lets you have user editable email templates through the admin interface.

Features
========

[](#features)

- Define app level email templates
- Predefine content in ss templates for ease of use
- Override framework or other module emails
- Store sent emails for tracking
- Emailing
- Sent emails' bodies compression (optional, requires `zlib`)

Predefined templates
====================

[](#predefined-templates)

Even if it is really nice to let your users edit the emails being sent, you need to provide an initial content to them. Creating all the emails manually is cumbersome, and maybe you already have some existing templates that you want to use.

To help you in this task, you have an ImportEmailTask thats imports all \*.ss templates in the /email folder that end with Email in the name, like /Email/MyTestEmail.ss. The content is imported in the "Content" area. You can also define divs with ids matching the name of the field:

```

```

I recommend that you store the email title alongside the content of the email, it makes things much easier to follow.

Also keep in mind that your content is escaped by default. So in your template you might need to do this:

```
    Hello $Member.Firstname,

    Here are your infos:
    $Member.SummaryTable.RAW
```

This will allow to render html content provided by the Member::SummaryTable method.

Also watch for nasty ending dots, don't forget to escape if necessary

```
    Without this, {$It.Will.Crash}.
