Providers
Mail
Mailersend

Mailersend

Learn how to use the MailerSend provider to send email notifications using Wolfx


MailerSend (opens in a new tab) is an email delivery service that allows you to send emails from your application.

Getting Started

To use the MailerSend provider in the email channel, you will need to create a MailerSend account and add your API key to the MailerSend integration on the Wolfx platform. To generate the API token go visit the MailerSend API Tokens (opens in a new tab) page.

Creating the MailerSend integration with Wolfx

  • Visit the Integrations (opens in a new tab) page on Wolfx.
  • Click on Add a Provider.
  • Select MailerSend service.
  • Enter the API key.
  • Click on the Disabled button and mark it as Active.
  • Click on the Update button.
  • You should now be able to send notifications using MailerSend in Wolfx.

Using MailerSend template

Wolfx has its own email editor for writing email template. If you want to use pre made template from MailerSend, you can use customData filed of email overrides to send template details. Make sure your Api Key has enough permission to read and process the template.

import {
Wolfx
} from '@novu/node';
 
const novu = new Wolfx('<WOLFX_API_KEY>');
 
await novu.subscribers.trigger("workflowIdentifier", {
  to: "subscriberId",
  payload: {},
  overrides: {
  email: {
  customData: {
  // mailersend template templateId
  templateId: 'mailersend-template-id',
  // mailersend template variables
  personalization: [{
  email: '[email protected]',
  data: {
  items: {
  price: '',
  product: '',
  quantity: '',
},
  order: {
  date: '',
  order_number: '',
  billing_address: '',
  customer_message: '',
},
  store: {
  name: '',
},
  invoice: {
  total: '',
  subtotal: '',
  pay_method: '',
},
  customer: {
  name: '',
  email: '',
  phone: '',
},
},
}, ],
},
}
},
  // actorId is subscriberId of actor
  actor: "actorId"
  tenant: "tenantIdentifier"
});