Newsletter Studio uses the built-in Notification mechanism in Umbraco to fire notification events.
Here's a simple example of a notification handler that kicks in just before an Email Service Provider sends an email.
public class EmailSendingHandler : INotificationHandler<EmailSendingNotification>
{
public void Handle(EmailSendingNotification notification)
{
// The Message-parameter, of type object, will be different
// concrete type depending on which Email Service Provider that is used.
if (notification.Message is MailMessage legacyMessage)
{
legacyMessage.Subject = "Glenn";
}
if (notification.Message is MimeMessage mimeMessage)
{
mimeMessage.Subject = "Glenn";
}
}
}
Please refer to the official Umbraco documentation for detailed instructions on how to set up a notification handler.
Here's a list of the current events that we're providing, we're working to add more events, feel free to reach out if you're missing something.
Fired by an Email Service Provider just before an e-mail is sent. The parameter will be the concrete e-mail message type for this provider.
Fired when the Newsletter Studio-tree has been rendered. Use this to change the menu items in the tree