Configure order statuses
Features described on this page require the Xperience by Kentico Advanced license tier.
Developer preview feature
The digital commerce feature is currently not fully functional, and primarily intended to allow technical users to familiarize themselves with the development process of the commerce feature. You can expect the feature to be updated and extended in upcoming releases.
The related API is marked as experimental and usage will result in warnings when compiling your project. The warnings are treated as errors for reporting purposes. To use the code, you need to suppress the warnings.
What should you do with this feature?
- DO try out development of digital commerce and examine the sample in the Dancing Goat project template.
- DO feel free to share your feedback with the Kentico Product team.
- DO NOT use this feature in public facing and production applications, as the feature is currently incomplete.
Create order statuses
- Navigate to the Commerce configuration application.
- Select New order status.
- Fill in the required fields.
- Order status name – the display name of the status.
- Notify the user when the order reaches this status – specifies whether selected users are notified when an order is moved to this status. See Configure notifications for order statuses.
Configure notifications for order statuses
First, you need to define the content of the email notification:
Prerequisite
Make sure that the service domain for notifications is set up in your project. For projects deployed in the Xperience by Kentico SaaS environment, the service domain is configured automatically.
- Navigate to the Notifications application.
- Select the Commerce order system notification and edit the email content.
- You can use content placeholders to include information about the order.
- Save the changes.
Now you need to enable the notification for individual statuses:
- Navigate to the Commerce configuration application.
- Select an order status for which you want users to receive a notification.
- Select the Notify the user when the order reaches this status checkbox.
- Select Recipients – users who you want to receive the notification whenever an order is moved to this status.
- Only users who have access to the Orders application can be selected.
- If a user is selected and later loses the access to the Orders application, they will still receive order notifications, but will not be able to view the orders.
- Save the changes.
Send notifications for new orders
Order notifications are automatically sent when moving existing orders between order statuses. If you want the system to send a notification to the selected users when a new order is created, you need to call the SendNotification
method of the IOrderNotificationService
service when creating the order.
//An instance of IOrderNotificationService can be retrieved using dependency injection
private readonly IOrderNotificationService orderNotificationService;
// Creates a new order object
var order = new OrderInfo()
{
...
};
// Sends a notification about the created order
await orderNotificationService.SendNotification(order.OrderID, cancellationToken);