Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Notification Center

The purpose of this extension is to provide a central and flexible way for Contao developers to send notifications via their extensions.

If we can get this extension to be widely used, users will quickly get used to the way one can configure the notification center.

Which version should I choose?

Contao Version Haste Version PHP Version Notification Center Version
<= 4.13 4.* ^7.0 ǀǀ ^8.0 1.6.*
4.13.* 5.* > 8.1 1.7.*
4.13.* ǀǀ 5.* 5.* > 8.1 2.*


The notification center can be translated via Transifex:

Adding your own notification type

// config.php
    // Type
    'iso_order_status_change'   => array
        // Field in tl_nc_language
        'recipients'    => array
            // Valid tokens
            'recipient_email' // The email address of the recipient
        'attachment_tokens'    => array
            'form_*', // All the order condition form fields
            'document' // The document that should be attached (e.g. an invoice)

Sending a notification

Extension developers most likely want to send a single notification identified by ID,:

$objNotification = \NotificationCenter\Model\Notification::findByPk($intNotificationId);
if (null !== $objNotification) {
    $objNotification->send($arrTokens, $strLanguage); // Language is optional

If you want to send all notifications of a certain type, you can send it like this:

$strType = 'iso_order_status_change';
$objNotificationCollection = \NotificationCenter\Model\Notification::findByType($strType);
if (null !== $objNotificationCollection) {
    while ($objNotificationCollection->next()) {
        $objNotification = $objNotificationCollection->current();
        $objNotification->send($arrTokens, $strLanguage); // Language is optional


It is possible to save the messages in a queue before sending them. The queue is available as a gateway. The queue can be processed via a "Poor man cron" or via a console call - see

$ queue -s <queue_gateway_id> -n <number of messages to be sent>


If you want to enrich each message being sent by some meta data or want to disable some messages being sent, you can use the sendNotificationMessage hook:

// config.php
$GLOBALS['TL_HOOKS']['sendNotificationMessage'][] = array('MyHook', 'execute');

// The hook
class MyHook
    public function execute($objMessage, $arrTokens, $language, $objGatewayModel)
         if (!$objMessage->regardUserSettings || !FE_USER_LOGGED_IN 
            || $objMessage->getRelated('pid')->type !== 'custom_notification') {
            return true;
         $user = \MemberModel::findByPK($arrTokens['recipient']);     
         if (!$user || !$user->disableEmailNotifications) {
            return true;
         return false;

Community Extensions

Note to self

Managing translations files.

  1. Install transifex client.

  2. tx pull -a to fetch updated translations.