Sending Emails
You can configure Liferay to send email notifications for different events that happen in your store. For example, you may want to send updates to the order manager or another person of interest with details of the order. This can include the order ID, shipping and billing addresses, the payment method used, and more. To do this, you must create a notification template that determines the email’s contents and event trigger.
To use notifications in Commerce, you must first configure Liferay’s mail settings. See Configuring Mail for more information.
There are two ways to set up these notifications.
- Creating a notification template to be executed as an Object Action (preferred)
- Creating a notification template at the channel level
Notification Templates (Object Action)
-
Open the Global Menu (
) and navigate to Control Panel → Templates.
-
Click Add (
) to create a notification template. See Notification Template for more information on configuring a template.
After creating a notification template, you must assign it as an object action on the Commerce Order object. See Defining Object Actions for more information.
Liferay DXP 2024.Q3+/Portal 7.4 GA125+ A new notification template called Commerce Order Notification is available out-of-the-box. It is an object action on the Commerce Order object that sends an email to the order creator when the order status changes to Pending. It is currently behind a release feature flag (LPD-24498).
Notification Queue
Liferay provides a notification queue for reviewing email notifications triggered by an Object action. You can verify the status of notifications and resend them if needed. See Notification Queue for more information.
Notification Templates (Channel)
-
Open the Global Menu (
) and navigate to Commerce → Channels.
-
Select the appropriate channel and go to Notification Templates.
-
Click Add (
) to create a notification template.
These notifications are configured per channel. When designing an email template, you can enter text directly or use variables to include data from the triggering event dynamically. See Using Notification Templates and Notification Template Variables Reference Guide for more information.
There’s also a Notification Queue tab under a channel that displays all the email notifications. Each email notification entry shows its sender, recipients, event type, status, and priority. By default, Liferay checks the notification queue every 15 minutes for unsent notifications. See Configuring the Commerce Notification Queue to learn how to configure this behavior.