PHPackages                             lekoala/silverstripe-foundation-emails - 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-foundation-emails

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

lekoala/silverstripe-foundation-emails
======================================

Better emails layout for SilverStripe

2.2(3y ago)71.3k2MITHTMLPHP ~7

Since Mar 1Pushed 2y ago3 watchersCompare

[ Source](https://github.com/lekoala/silverstripe-foundation-emails)[ Packagist](https://packagist.org/packages/lekoala/silverstripe-foundation-emails)[ RSS](/packages/lekoala-silverstripe-foundation-emails/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (1)Versions (6)Used By (0)

SilverStripe Foundation Emails module
=====================================

[](#silverstripe-foundation-emails-module)

Replace the default html template by one made with \[Foundation Emails\] ().

The email templates use [zurb/foundation-emails](https://github.com/foundation/foundation-emails) to provide a consistent markup.

Expanded generic emails
=======================

[](#expanded-generic-emails)

The generic email comes with a few new options:

- If you define a Callout, it will be displated as a callout
- If you define a Sidebar, a right sidebar will be displayed (ratio 7/5)
- If you define a HeroImage (an Image object), it will be displayed below the body and before the callout

```
$email = new Email();
$email->addData([
'EmailContent' => 'Here is my body',
'Callout' => 'Here is my callout',
'Sidebar' => 'Here is my sidebar',
'HeroImage' => Image::get()->first()
]);
```

A default Header and Footer is provided:

- The header display the logo or the title of the website
- The footer display the social medias links and a user defined text in the SiteConfig (under EmailFooter)

In the footer, social medias links should be provided through the EmailFooterLinks method on the SiteConfig. Each item consist of a : Class, Link, Label and Icon.

NOTE: do not use setBody because it will prevent the usage of the default template. Instead, rely on addData(\['EmailContent' =&gt; $body\]).

Template helpers
================

[](#template-helpers)

Instead of relying on specific markup, you can also use template helpers directly in your email templates. For instance:

```
$email = new Email();
$viewer = new SSViewer('MyEmailTemplate');
$result = $viewer->process($this);
$email->addData(['EmailContent' => (string) $result]);

Dear Customer,
Please find your password reset link:
$FoundationButton('Reset your passowrd', $PasswordResetLink)
```

Available helpers are:

- FoundationSpacer
- FoundationButton
- FoundationCallout
- FoundationContainer

Make it your own styles
=======================

[](#make-it-your-own-styles)

The templates are divided in various include which allow you to easily make them fit your styles.

To define your base styles, override FoundationEmailStyles.ss.

To define your own headers and footers, override FoundationEmailFooter and FoundationEmailHeader.

Two other styles are provided : "vision" and "ceej". Feel free to use the one you like the most. You can select your theme by applying the following config.

```
FoundationEmails:
    theme: "vision"
```

You can also edit basic color or use extension point "updateFoundationColors".

```
FoundationEmails:
    colors:
        HeaderBg: "#333"
        Header: "#fff"
        Link: "#2199e8"
        Background: "#f3f3f3"
        CalloutBg: "#ddd"
        Callout: "#ddd"
        BtnBg: "#333"
        Btn: "#fff"
```

Consistent ChangePassword and ForgotPassword templates
======================================================

[](#consistent-changepassword-and-forgotpassword-templates)

These default templates have been overriden.

NOTE : we include a button to reset the password instead of a plain link.

Create new emails
=================

[](#create-new-emails)

As explained in the \[SilverStripe documentation\] ([https://docs.silverstripe.org/en/4/developer\_guides/email/](https://docs.silverstripe.org/en/4/developer_guides/email/)) you can create subclasses of the Email class.

An example class has been provided called WelcomeEmail.

Testing emails
==============

[](#testing-emails)

For your convenience, a task called "Email Viewer Task" has been provided.

This task allow you to select any subclass of the Email class and see its html (preview and code).

You can also set the locale and inline styles (require pelago/emogrifier) for better testing.

If your emails require constructor arguments that are DataObjects, random records from your database will be injected. If you want to inject specific records, pass ClassNameID=YourID as GET parameters (for instance MemberID=5).

Compatibility
=============

[](#compatibility)

Tested with 4.1+

Maintainer
==========

[](#maintainer)

LeKoala -

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~480 days

Total

5

Last Release

1439d ago

Major Versions

1.x-dev → 2.02019-03-11

PHP version history (2 changes)1.0PHP &gt;=5.4.8

2.0PHP ~7

### Community

Maintainers

![](https://www.gravatar.com/avatar/701d0bd1837aa291814dafee750a02471e7e0d20749626350231ffd3bfec0ec1?d=identicon)[lekoala](/maintainers/lekoala)

---

Top Contributors

[![lekoala](https://avatars.githubusercontent.com/u/250762?v=4)](https://github.com/lekoala "lekoala (41 commits)")

---

Tags

foundationsilverstripesilverstripecmsmodulefoundationemails

### Embed Badge

![Health badge](/badges/lekoala-silverstripe-foundation-emails/health.svg)

```
[![Health](https://phpackages.com/badges/lekoala-silverstripe-foundation-emails/health.svg)](https://phpackages.com/packages/lekoala-silverstripe-foundation-emails)
```

###  Alternatives

[lekoala/silverstripe-mandrill

Adds mandrill in the SilverStripe CMS

1827.3k](/packages/lekoala-silverstripe-mandrill)[friendsofsilverstripe/backendmessages

DRY way to create message boxes in SilverStripe backend.

1015.4k2](/packages/friendsofsilverstripe-backendmessages)[axyr/silverstripe-adminlogin

Use a custom login screen to log in to the admin section

165.8k](/packages/axyr-silverstripe-adminlogin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
