1.0.0 2019-04-16 09:40 UTC

This package is auto-updated.

Last update: 2024-02-14 20:26:01 UTC


Build Status

Notifire is a PHP library that centralizes the management of notifications (e-mails, sms, push notifications, etc.).


  • php >= 7.2
  • symfony/event-dispatcher >= 4.3
  • symfony/options-resolver >= 4.3


The suggested installation method is via composer:

$ composer require fazland/notifire

Using Notifire

Every notification in Notifire triggers an Event (the NotifyEvent) which will be handled by an instance of NotifyEventSubscriber (later named by handlers). Those notifications must implement NotificationInterface and registered with Notifire::addNotification() in order to be read by Notifire.

Notifire provides 2 standard implementations (Email and Sms) and theirs handlers (the defaults are SwiftMailerHandler and TwilioHandler).

Notifire is really simple to use:


First of all Notifire has to be initialized. Two ways:

  1. run in order to autoconfigure the e-mail with SwiftMailer as its Handler
  1. custom configuration with NotifireBuilder by registering the notifications and the desired instance of EventDispatcherInterface

$dispatcher = new EventDispatcher();

$builder = NotifireBuilder::create()

$builder->addHandler(new SwiftMailerHandler($mailer, 'mailer_one'));
$builder->addNotification('email', Email::class);


Now you're ready! To create an Email just use Notifire::email(), fill the fields like from, to, parts etc. and then use Email::send():

// Use 'mailer_one' handler to send this message
$email = Notifire::email('mailer_one');

    ->setSubject('Only wonderful E-mails with Notifire!')
    ->addPart(Part::create($body, 'text/html'))


Contributions are welcome. Feel free to open a PR or file an issue here on GitHub!


Notifire is licensed under the MIT License - see the LICENSE file for details