Mails
API

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' }] },
});
ParameterTypeDescription
keystringKey of mail type that you created in ROQ Console, e.g."WELCOME_NOTIFICATION"
localestringLocale (language) of the mail, eg "en-US"
emailsarrayList of email addresses
dataarrayArray with key/value pairs. You can use this data in the template

This endpoint is only available from the server side of your application.