Multichannel Store Notifications documentation
This documentation is for developers. Use it to install and maintain the modules, or to publish notifications from your own module.
Requirements
You need the following:
- Magento Open Source or Adobe Commerce 2.4.7 or later.
- PHP 8.1, 8.2, 8.3, 8.4 or 8.5.
- A working Magento cron. The cron starts the message queue consumers (
cron_consumers_runner). You can run the consumer under supervisor instead. - For email, either Magento's own mail must work, or the store must be able to reach an SMTP server.
- For Telegram, Slack and Discord, the store must be able to reach
api.telegram.org,hooks.slack.comanddiscord.comover HTTPS. - For Microsoft Teams, allow HTTPS to the workflow host ending in
.environment.api.powerplatform.comor.logic.azure.com. See Microsoft Teams. - For WhatsApp, allow HTTPS to
graph.facebook.com. It needs Notification 1.1 or later. See WhatsApp. - For Webhook, the store must be able to reach your HTTPS receiver directly, without an HTTP proxy. See Webhook.
Packages
arlanix/notification is a metapackage. It installs every package in the following table at matching versions.
| Package | Module | Purpose |
|---|---|---|
arlanix/module-core |
Arlanix_Core |
Code that every Arlanix module uses: logging, templates and the support bundle. |
arlanix/module-notification |
Arlanix_Notification |
Topics, subscriptions, rules, the Message Log, publishing, Webhook delivery, and delivery through the message queue. |
arlanix/module-notification-smtp |
Arlanix_NotificationSmtp |
Email, through Magento's mail or a separate SMTP server. |
arlanix/module-notification-telegram |
Arlanix_NotificationTelegram |
Telegram, through the store's bot or a bot set on the subscription. |
arlanix/module-notification-slack |
Arlanix_NotificationSlack |
Slack, through the channel's incoming webhook. |
arlanix/module-notification-discord |
Arlanix_NotificationDiscord |
Discord, through the channel's webhook. |
arlanix/module-notification-teams |
Arlanix_NotificationTeams |
Microsoft Teams, through the channel's Workflows URL. |
arlanix/module-notification-whatsapp |
Arlanix_NotificationWhatsapp |
WhatsApp, through an approved template message to one number. |
arlanix/module-notification-event |
Arlanix_NotificationEvent |
Store events for rules: orders, invoices, refunds, shipments, customers, reviews, newsletter subscriptions and the contact form. |
arlanix/module-notification-monitoring |
Arlanix_NotificationMonitoring |
Store health events for rules: admin sign-ins, cron, indexers, errors, orders that stop, imports and exports. It also adds a health check URL. |
How a message is delivered
A message goes through four stages:
Emit or publish. A module emits one of its declared events through
Arlanix\Notification\Api\EmitterInterface, or dispatches the Magento eventarlanix_notification_emit. Each active rule for that event checks its conditions. When they match, the rule publishes its message to its topic. A module can also publish a message directly, throughPublisherInterface::publish()or the eventarlanix_notification_publish.In both cases, the message is saved in
arlanix_notification_message. A row is added toarlanix_notification_deliveryfor each active subscription of the topic whose minimum severity the message meets. The id of each delivery is published to the queue topicarlanix.notification.deliver.The PHP methods catch and log failures. A Magento event dispatch can still throw; wrap it in
try/catchand log the failure as shown in Declare events. Neither path waits for a mail server or a chat service. Only a message sent at once without the queue, such as Cron stopped, waits for its delivery. See Publish from your module.Merge. The consumer
arlanix_notification_deliverreads up to 100 queue messages at a time and passes them to its handler together. The handler groups them by subscription. All deliveries for one subscription in a batch are sent as one digest. A digest holds up to 25 entries, and more entries are split into several digests. A message published several times is one entry.Deliver. The consumer claims each delivery before it sends it. So a queue message that arrives twice is sent only once. The subscription's protocol (email, Telegram, Slack, Discord, Microsoft Teams, WhatsApp or Webhook) sends the digest. When sending fails, the delivery stores the error and the time of the next attempt.
Retry. The cron job
arlanix_notification_requeueputs deliveries back on the queue in three cases. The retry of a failed delivery is due. A consumer stopped while it was sending the delivery. The queue message of the delivery was lost.
For details, see Queue, cron and command line.