Transactional 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.

Mutations

sendMail()

ℹ️

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

The sendMail() mutation can be used to send e-mails. The mutation returns the number of emails sent. You can find the full API doc of this mutation here (opens in a new tab).

await client.asSuperAdmin().sendMail({
  mail: {
      key: 'abc123',
      locale: 'abc123',
      emails: ['xyz789'],
      data: [{ key: 'xyz789', value: 'xyz789' }] },
});
ParameterTypeDescription
keystringKey of mail type that you created in ROQ Console, eg."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