Notifications module provides the infrastructure necessary to send notification to the app users.
There are many methods to send notifications to a user (e.x., Email, Web Push, Mobile Push, SMS, etc.). Any notification should appear in the notification center.
When multiple notification methods are enabled, the user can opt-in/out any method they wishes to receive by editing their profile.
Email Notifications feature offers a means to inform users by dispatching notifications through email.
Email Notifications feature, you must also configure the SMTP Service.
SMS Notifications feature offers a means to inform users by dispatching notifications through phone via SMS provider.
Email SMS feature, you must also configure the SMS Provider.
Adding Custom Notification Provider¶
To add a new notification method like
Mobile Push or
SMS, you can simply implement the
INotificationMethodProvider interface. Then, register your new implementation. For example, in the
Email Notifications feature we register the email notification provider like this
public class EmailNotificationsStartup : StartupBase
public override void ConfigureServices(IServiceCollection services)
How to send a notification¶
You can send notification to a user via code by injecting
INotificationService then calling the
SendAsync(...) method. Alternatively, you can use workflows to notify a user about an event that took place.
OrchardCore.Workflows feature is enabled, you'll see new activities that would allow you to notify users using workflows. Here are some of the available workflow tasks
- Notify Content's Owner Task
- Notify User Task