PHPackages                             symbiote/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. [Mail &amp; Notifications](/categories/mail)
4. /
5. symbiote/silverstripe-notifications

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

symbiote/silverstripe-notifications
===================================

Send CMS editable system notifications from code

4.7.0(3y ago)155.8k143BSD-3-ClausePHPPHP &gt;=5.6.0CI failing

Since May 30Pushed 3y ago8 watchersCompare

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

READMEChangelog (6)Dependencies (3)Versions (37)Used By (3)

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 4.0 +

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

[](#installation-instructions)

```
composer require symbiote/silverstripe-notifications

```

Sending a notification
----------------------

[](#sending-a-notification)

The module comes with a default BroadcastNotification object that can be used to send a notification to multiple people at once. First, create the SystemNotification (which defines how the notification will be sent)

> Notifications =&gt; Add System Notification

- Identifier: BROADCAST
- Title: (your own)
- Relevant For: BroadcastNotification
- Send via channels: Internal
- Text: (Your own; use $Context.Content to output the broadcast content)

> Notifications =&gt; Add Broadcast Notification

- Title: (your own)
- Content: (your own)
- Click Create
- Groups: choose which groups to receive the notification
- Send Now: Click when ready for the notification to send.

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

[](#creating-system-notifications)

Creating custom notifications requires a few pieces of code to put things together. Use the BroadcastNotification as an example, with the key points identified below

### 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.

```
Symbiote\Notifications\Model\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.

```
use Symbiote\Notifications\Model\NotifiedOn;

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:

- $ThemeDirs (an ArrayList object of themes, if you only have one theme using `$ThemeDirs.First` should be the same as the old `$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

```
use Symbiote\Notifications\Service\NotificationService;

singleton(NotificationService::class)->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:

```
Symbiote\Notifications\Model\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 -

```
Symbiote\Notifications\Service\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

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community27

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 61.1% 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 ~140 days

Recently: every ~228 days

Total

23

Last Release

1278d ago

Major Versions

0.2.0 → 1.0.02015-02-17

1.0.3 → 2.0.02017-06-23

2.0.x-dev → 4.0.02018-02-04

PHP version history (2 changes)0.2.0PHP &gt;=5.3.2

4.0.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23506857?v=4)[Symbiote](/maintainers/symbiote)[@symbiote](https://github.com/symbiote)

---

Top Contributors

[![nyeholt](https://avatars.githubusercontent.com/u/161730?v=4)](https://github.com/nyeholt "nyeholt (44 commits)")[![sheadawson](https://avatars.githubusercontent.com/u/1166136?v=4)](https://github.com/sheadawson "sheadawson (13 commits)")[![stephenmcm](https://avatars.githubusercontent.com/u/2093185?v=4)](https://github.com/stephenmcm "stephenmcm (6 commits)")[![ryanwachtl](https://avatars.githubusercontent.com/u/341209?v=4)](https://github.com/ryanwachtl "ryanwachtl (2 commits)")[![axyr](https://avatars.githubusercontent.com/u/345155?v=4)](https://github.com/axyr "axyr (2 commits)")[![jason-zz](https://avatars.githubusercontent.com/u/6354744?v=4)](https://github.com/jason-zz "jason-zz (1 commits)")[![mlewis-everley](https://avatars.githubusercontent.com/u/687143?v=4)](https://github.com/mlewis-everley "mlewis-everley (1 commits)")[![AljosaB](https://avatars.githubusercontent.com/u/1818329?v=4)](https://github.com/AljosaB "AljosaB (1 commits)")[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (1 commits)")[![nspyke](https://avatars.githubusercontent.com/u/901747?v=4)](https://github.com/nspyke "nspyke (1 commits)")

---

Tags

silverstripenotifications

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[silverstripe/mimevalidator

Checks uploaded file content roughly matches a known MIME type for the file extension.

102.0M9](/packages/silverstripe-mimevalidator)[markguinn/silverstripe-email-helpers

Silverstripe extension containing SMTP mailer class and some other classes for HTML emails

3145.4k1](/packages/markguinn-silverstripe-email-helpers)[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)

PHPackages © 2026

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