The Juszczyk_OrderNotification module allows you to sending notifications to different channels when a new order is place.
The Juszczyk_OrderNotification module does not make any changes in database.
To install the module:
- Go to your Magento installation directory
- Run command:
composer require juszczyk/module-order-notification
- Run command:
bin/magento module:enable Juszczyk_OrderNotification
- Run command:
bin/magento setup:upgrade
- Run command:
bin/magentp setup:static-content:deploy
For information about a module installation, see Enable or disable modules.
The Juszczyk_OrderNotification module adds functionality to send notifications of order placement through various channels. The default channels are email, Slack, WhatsApp, SMS.
Configuration of the module is located on the Sales tab in Order Notification section.
The General group has fields that allow you to enable/disable the module and to select groups of customers whose orders will be subject to sending notifications.
The Channels group contains specific configuration for each channel and the ability to enable/disable them.
For information about a typical file structure of a module in Magento 2, see Module file structure.
Extension developers can interact with the Juszczyk_OrderNotification module.
Developers can add their own notification feeds by following these instructions:
- Add new channel model that extends
Juszczyk\Model\AbstractChannel
and implements required methods. - Add previously created channel to
etc/di.xml
file by following the default channels created. - Add channel configuration to
etc/adminhtml/system.xml
with requiredenable
field.
The module Juszczyk_OrderNotification dispatches the following events:
order_notification_{{CHANNEL_CODE}}_send_before
event in channels model (Model\Channel\...
) methodsend(Order $order)
. Parameters:order
is an order on which notification will be sent (Magento\Sales\Model\Order
)order_data
is a order data that was prepared to send for the notification (array
)
For information about an event in Magento 2, see Events and observers.