Skip to main content
POST
/
emails
JavaScript
import Nuntly from '@nuntly/sdk';

const client = new Nuntly({
  apiKey: process.env['NUNTLY_API_KEY'], // This is the default and can be omitted
});

const response = await client.emails.send({
  from: 'from',
  subject: 'subject',
  to: ['string'],
});

console.log(response.id);
{
  "data": {
    "id": "<string>",
    "status": "queued"
  }
}

Authorizations

Authorization
string
header
required

Bearer HTTP authentication. Allowed headers Authorization: Bearer <API_KEY>

Body

application/json
from
string
required

The e-mail address of the sender

to
required

The primary recipient(s) of the email

subject
string
required

The subject of the e-mail

cc

The carbon copy recipient(s) of the email

bcc

The blind carbon copy recipient(s) of the email

replyTo

The email address where replies should be sent. If a recipient replies, the response will go to this address instead of the sender's email address

text
string

The plaintext version of the email

html
string

The HTML version of the email

headers
object

The headers to add to the email

tags
object[]

The tags to add to the email

attachments
object[]

The attachements to add to the email

context
object

The context for the template

scheduledAt
string

The date at which the email is scheduled to be sent

Response

200 response

data
object
required