PHPackages                             sheadawson/silverstripe-notifications - 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. sheadawson/silverstripe-notifications

ActiveSilverstripe-module

sheadawson/silverstripe-notifications
=====================================

Send CMS editable system notifications from code

1.0.2(10y ago)0244BSD-3-ClausePHPPHP &gt;=5.3.2

Since May 30Pushed 9y ago1 watchersCompare

[ Source](https://github.com/sheadawson/silverstripe-notifications)[ Packagist](https://packagist.org/packages/sheadawson/silverstripe-notifications)[ RSS](/packages/sheadawson-silverstripe-notifications/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (7)Used By (0)

SilverStripe Notifications Module
=================================

[](#silverstripe-notifications-module)

Send CMS managed system email notifications from code.

Maintainer Contacts
-------------------

[](#maintainer-contacts)

- Marcus Nyeholt ()
- Shea Dawson ()

Requirements
------------

[](#requirements)

- SilverStripe 3.1 +

Installation Instructions
-------------------------

[](#installation-instructions)

```
composer require sheadawson/silverstripe-notifications

```

Creating System Notifications
-----------------------------

[](#creating-system-notifications)

### 1)

[](#1)

In your \_config yml file, add an identifier for each notification you require. This allows you to lookup Notification objects in the database from your code.

```
SystemNotification:
  identifiers:
    - 'NAME_OF_NOTIFICATION1'
    - 'NAME_OF_NOTIFICATION2'

```

### 2)

[](#2)

Add the NotifiedOn interface to any dataobjects that are relevant to the notifications you will be sending. This is required so the Notifications module can look up the below methods on your object to send the notification.

```
class MyDataObject extends DataObject implements NotifiedOn {
	...
```

Define the following interface methods on the Object being notified on.

```
/**
 * Return a list of available keywords in the format
 * array('keyword' => 'A description') to help users format notification fields
 * @return array
 */
public function getAvailableKeywords();
```

```
/**
 * Gets an associative array of data that can be accessed in
 * notification fields and templates
 * @return array
 */
public function getNotificationTemplateData();
```

Note: the follow template data is automatically included:

- $ThemeDir
- $SiteConfig
- $MyDataObject (whatever the ClassName of your NotifiedOn DataObject is)
- $Member (The Member object this message is being sent to)

```
/**
 * Gets the list of recipients for a given notification event, based on this object's
 * state.
 * $event The identifier of the event that triggered this notification
 * @return array An array of Member objects
 */
public function getRecipients($event);
```

Note: getRecipients() can return an array of any objects, as long as they have an Email property or method

### 3)

[](#3)

Create a notification in the Notifications model admin, in the CMS.

### 4)

[](#4)

Send the notification from your code, where $contextObject is an instance of the DataObject being NotifiedOn

```
singleton('NotificationService')->notify('NOTIFICATION_IDENTIFIER', $contextObject);
```

Templates
---------

[](#templates)

Notifications can be rendered with .ss templates. This is useful if you want to have a header/footer in your email notifications. You can either specify a template on a per/notification basis in the CMS, and/or set a default template for all notifications to be rendered with:

```
SystemNotification:
  default_template: EmailNotification

```

In your templates, you render the notification text with the $Body variable.

Configuration
-------------

[](#configuration)

You will probably want to configure a send\_from email address -

```
EmailNotificationSender:
  send_notifications_from: 'notifications@example.com'

```

TODO
----

[](#todo)

- Test with QueuedJobs module for handling large amounts of notifications in configurable batches/queues

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 73.9% 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 ~118 days

Total

5

Last Release

3891d ago

Major Versions

0.2.0 → 1.0.02015-02-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ca23b453a4fc5ac237ad4fcc512f68fab5c7b124f403cad1a5848b3fffb6aa2?d=identicon)[sheadawson](/maintainers/sheadawson)

---

Top Contributors

[![sheadawson](https://avatars.githubusercontent.com/u/1166136?v=4)](https://github.com/sheadawson "sheadawson (17 commits)")[![nyeholt](https://avatars.githubusercontent.com/u/161730?v=4)](https://github.com/nyeholt "nyeholt (3 commits)")[![ryanwachtl](https://avatars.githubusercontent.com/u/341209?v=4)](https://github.com/ryanwachtl "ryanwachtl (2 commits)")[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (1 commits)")

---

Tags

silverstripenotifications

### Embed Badge

![Health badge](/badges/sheadawson-silverstripe-notifications/health.svg)

```
[![Health](https://phpackages.com/badges/sheadawson-silverstripe-notifications/health.svg)](https://phpackages.com/packages/sheadawson-silverstripe-notifications)
```

###  Alternatives

[silverstripe-terraformers/gridfield-rich-filter-header

Rich filter header component for GridField

1325.7k1](/packages/silverstripe-terraformers-gridfield-rich-filter-header)[symbiote/silverstripe-notifications

Send CMS editable system notifications from code

155.8k3](/packages/symbiote-silverstripe-notifications)

PHPackages © 2026

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