Download the PHP package devskio/ds_notifier without Composer
On this page you can find all versions of the php package devskio/ds_notifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ds_notifier
Notifier
The ds_notifier
extension for TYPO3 CMS provides a flexible notification system that can handle various notification channels like Email and Slack (upcoming). It allows for dynamic event handling and custom notification configurations.
Features
- Dynamic Event Handling: Utilize custom events to trigger notifications.
- Multiple Notification Channels: Supports Email, and potentially more channels in the future (Slack, ...).
- Event-Driven Notifications: Configure notifications based on system or custom events.
- Localization Support: Comes with built-in support for translations.
Requirements
- PHP 8.3 or higher
- TYPO3 CMS 13.4 or higher
Installation
-
Install the extension via Composer:
- Run database compare to add the new tables.
Usage
Built-in events
Notiz is shipped with a few built-in events that can be used to trigger notifications.
TYPO3: Cache Flush
The CacheFlush event is triggered when TYPO3's caching system is flushed. This can occur during various system maintenance tasks or via explicit backend actions. Handling this event allows developers to notify system administrators when the cache is cleared.
Notifier: Notification Send Error
The NotificationSendError event is triggered when there is an error during the notification sending process. This event allows for handling errors specifically related to the notification system, such as logging errors, sending alerts to administrators, or attempting to resend notifications. It provides a mechanism to robustly manage failures in the notification delivery process.
Scheduler: Task failure
The TaskFailure event is triggered when there is scheduler task failure. This allow for prompt notification of system administrators when a scheduled task fails. Tha can also serve as logging mechanism for task failures.
Form: Submit Finisher
The Form Framework finisher which is triggered at the end of the form submission process in TYPO3's form framework. This event allows for custom actions to be executed after a form has been successfully submitted and processed. It is particularly useful for integrating additional notifications related to form submissions.
Notifications and recipients configuration
The extension can be configured via TYPO3's backend configuration modules. You can set up different notification channels, layouts, and more.
Create a notification recipient
We need to set up Recipient record first, so we can use it later in Notification record. To set up a notification recipient, in Backend navigate to List module and create a new record of type "Recipient". Here we can define for which type of communication channel recipient is meant, either Email or Slack, then fill in the required fields and save the record.
For slack we also need to define slack webhook for specific channel. Here you can find more information on how to get your slack webhook.
Create a notification
To create a notification, in Backend navigate to List module and create a new record of type "Notification". We select for which communication channel is this notification meant, then we can select specific event when this notification is supposed to be sent and for which sites it's supposed to available.
NOTE: For "Form: Submit Finisher event", we first need to add Notifier finisher as Finisher in form configuration, so we can select this form later in notification record.
After event is selected, we can define, notifications body, layout and see available markers for body, that can be used inside body.
NOTE: For "Form: Submit Finisher event", we can use form fields like {formValues}.{formFieldHandle} for example {formValues}.{text-1}.
Next we select recipient of the notification, we can select multiple recipients for one notification.
For slack setting up notification is similar to email, but we need to select slack recipient where notification will be sent.
After save, notification should be ready to be sent when respective event is triggered.
Triggering notifications
Predefined events are triggered by their respective events (cache flush, form submit finisher, error occurrence). But all notifications can be triggered in code by calling TYPO3's EventDispatcher
and passing event object with optional data.
Customization
Developers can extend the functionality by creating custom layouts, event handlers or notification channels.
Custom layouts and templates override
You can override email templates via Typo3's Fluid email paths.
To create a custom layouts for your notifications you need to add it to via TCEFORM.tsconfig
.
Custom events
You can create custom events by implementing the EventInterface
via our class AbstractEvent
and dispatching them via TYPO3's EventDispatcher
in your code.
Each event should have a label, group defined via tags, that are displayed in notification configuration and optional flexibleConfiguration for adding custom Flex form. Language translations can be used. Next each event
can have a specific markers, that can be used in notification body, and specific recipients, that will receive the notification. All this data can be passed from
class to constructor, and then used in event object. All markers and emails are displayed in notification configuration.
NOTE: Group must be enumeration.
If email template is created for custom event, it should be placed in your_extension/Resources/Private/Templates/Email/EventGroupName/CustomEventName.html
. Then that template will be used in for notification body, otherwise default will be used.
Extending Notification Channels
Custom notification channel can be created by extending the NotificationInterface
via our custom class Notification
.
In your custom channel class you need to define your notification login in send()
function.
This new notification channel must be registered in Classes.php configuration.
And of course don't forget to override notification TCA for new channel to display and configure it in notification record.
Support
For support, contact the development team at DEVSK.
License
This project is licensed under the GPL-2.0-or-later. See the LICENSE
file for more details.