Mails API
Introduction
ROQ Platform provides a unified way to send emails utilizing multiple providers like Sendgrid, Mandrill, Mailgun, and others. Please refer to the mails feature guide for more information and instructions.
Send mails
sendMail()
The sendMail()
method can be used to send emails. It returns the number of emails sent.
await client.asSuperAdmin().sendMail({
mail: {
key: 'onboarding',
locale: 'en-US',
emails: ['Francis84@roq.tech'],
data: [{ key: 'name', value: 'Francis84' }] },
});
Parameter | Type | Description |
---|---|---|
key | string | Key of mail type that you created in ROQ Console, e.g."WELCOME_NOTIFICATION" |
locale | string | Locale (language) of the mail, eg "en-US" |
emails | array | List of email addresses |
data | array | Array with key/value pairs. You can use this data in the template |
This endpoint is only available from the server side of your application.