Download the PHP package tobento/service-notifier without Composer

On this page you can find all versions of the php package tobento/service-notifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package service-notifier

Notifier Service

Notifier interface for PHP applications using Symfony Notifier as default implementation.

Table of Contents

Getting started

Add the latest version of the notifier service project running this command.

Requirements

Highlights

Documentation

Basic Usage

Creating And Sending Notifications

Once you have created the notifier you can create and send notifications:

Check out the Notifications section to learn more about the available notifications you can create or you might create your own notification class fitting your application.

Check out the Recipients section to learn more about the available recipients you can create or you might create your own recipient class fitting your application.

Notifier

Create Notifier

Check out the Channels section to learn more about the available channels.

Notifications

Notification

The may be used to create simple notification messages supporting all channels.

If you want to support custom channels you may consider creating a custom notification!

Available methods

In addition, you may add messages for specific channels:

Abstract Notification

Use the if you want to create specific messages for each channel.

Simply extend from the and add the message interfaces with its method you want to support.

Furthermore, any methods such as will receive a entity, the name and you may request any service being resolved (autowired) by the container.

Recipients

Recipient

The may be used to create a recipient supporting all channels.

User Recipient

The may be used if you have installed the User Service.

Channel

Mail Channel

The mail channel uses the Mail Service to send notifications.

Mail Notification

To send mail notifications you have multiple options:

Using the Abstract Notification

Simply extend from the and implement the interface. The interface requires a method which is already added on the defining the method as the message handler. You will just need to add the method which will receive a entity, the name and you may request any service being resolved (autowired) by the container.

If you do not have defined a default from address, you will need to set it on each message:

Using the Notification

Check out the Mail Message section to learn more about mail messages.

Mail Recipient

When sending notifications via the mail channel, the channel will call the method on the recipient entity to get the email address when no were defined on the mail message.

Mail Channel Factory

Sms Channel

Use the to create a SMS channel using the Symfony SMS Channel:

You will need to install any chat service you would like e.g.

Sms Notification

To send SMS notifications you have multiple options:

Using the Abstract Notification

Simply extend from the and implement the interface. The interface requires a method which is already added on the defining the method as the message handler. You will just need to add the method which will receive a entity, the name and you may request any service being resolved (autowired) by the container.

Using the Notification

Sms Recipient

When sending notifications via the sms channel, the channel will call the method on the recipient entity to get the sms address when no specific were defined.

Chat Channel

Use the to create a chat channel using the Symfony Chat Channel:

You will need to install any chat service you would like e.g.

Chat Notification

To send chat notifications you have multiple options:

Using the Abstract Notification

Simply extend from the and implement the interface. The interface requires a method which is already added on the defining the method as the message handler. You will just need to add the method which will receive a entity, the name and you may request any service being resolved (autowired) by the container.

Using the Notification

Chat Recipient

When sending notifications via the chat channel, you may add a specific channel address with parameters for later usage.

Sample notification with address usage

Push Channel

Use the to create a push channel using the Symfony Push Channel:

You will need to install any push service you would like e.g.

Push Notification

To send push notifications you have multiple options:

Using the Abstract Notification

Simply extend from the and implement the interface. The interface requires a method which is already added on the defining the method as the message handler. You will just need to add the method which will receive a entity, the name and you may request any service being resolved (autowired) by the container.

Using the Notification

Push Recipient

When sending notifications via the push channel, you may add a specific channel address with parameters for later usage.

Sample notification with address usage

Storage Channel

The storage channel stores the notification information in the configured storage repository.

Check out the Repository Service to learn more about it.

The storage needs to have the following table columns:

Column Type Description
bigint(21) primary key -
varchar(255) Used to store the notification name
varchar(36) Used to store the recipient id
varchar(255) Used to store the recipient type
json Used to store the message data
datetime Used to store date read at
datetime Used to store date created at

Storage Repository

You may use the provided as repository implementation:

You will need to install the service:

Check out the Storage Service - Storages for the available storages.

Check out the Repository Storage Service to learn more about it in general.

Storage Notification

To send Storage notifications you have multiple options:

Using the Abstract Notification

Simply extend from the and implement the interface. The interface requires a method which is already added on the defining the method as the message handler. You will just need to add the method which will receive a entity, the name and you may request any service being resolved (autowired) by the container.

Using the Notification

Storage Recipient

When sending notifications via the storage channel, the channel will store the and values which you can later use to fetch notifications:

Accessing Storage Notifications

Once notifications are stored, you can retrieve the notifications using the repository from the channel:

Channels

Default Channels

Lazy Channels

The creates the channels only on demand.

Queue

You may queue your notification by just adding the parameter:

Requirements

To support queuing notifications you will need to pass a queue handler to the notifier.

Consider using the default queue handler using the Queue Service:

First, install the queue service:

Finally, pass the queue handler to the notifier:

Events

You may listen to the following events if your notifier is configured to support it.

Event Description
The Event will be fired before sending the notification.
The Event is fired after the notification is sent.
The Event will be fired after queuing the notification.

When using the default notifier just pass an event dispatcher.

Credits


All versions of service-notifier with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
tobento/service-filesystem Version ^1.0.5
tobento/service-autowire Version ^1.0
tobento/service-repository Version ^1.0.1
tobento/service-mail Version ^1.0
psr/container Version ^2.0
psr/http-message Version ^1.0
psr/event-dispatcher Version ^1.0
symfony/notifier Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tobento/service-notifier contains the following files

Loading the files please wait ....