import Nuntly from '@nuntly/sdk';
const client = new Nuntly({
apiKey: 'My API Key',
});
const response = await client.emails.bulk.send({
emails: [
{ from: 'ray@info.tomlinson.ai', subject: 'Welcome to Tomlinson AI!', to: 'carlo43@gmail.com' },
{ from: 'ray@info.tomlinson.ai', subject: 'Welcome to Tomlinson AI!', to: 'pink42@yahoo.com' },
],
});
console.log(response.id);
{
"data": {
"id": "blk_01jnvnn9avq52k5mrhn1gab0ce",
"kind": "bulk-email",
"emails": [
{
"id": "em_01jnvnn9avq52k5mrhn1gab0ci",
"org_id": "org_01jh6jk82zjq9deye73h0mzcaq",
"status": "queued",
"kind": "email"
},
{
"id": "em_01jnvnn9avq52k5mrhn1gab0cj",
"org_id": "org_01jh6jk82zjq9deye73h0mzcaq",
"status": "queued",
"kind": "email"
},
{
"status": "rejected",
"error": "The domain is not verified",
"kind": "email"
}
]
}
}
Send bulk emails
import Nuntly from '@nuntly/sdk';
const client = new Nuntly({
apiKey: 'My API Key',
});
const response = await client.emails.bulk.send({
emails: [
{ from: 'ray@info.tomlinson.ai', subject: 'Welcome to Tomlinson AI!', to: 'carlo43@gmail.com' },
{ from: 'ray@info.tomlinson.ai', subject: 'Welcome to Tomlinson AI!', to: 'pink42@yahoo.com' },
],
});
console.log(response.id);
{
"data": {
"id": "blk_01jnvnn9avq52k5mrhn1gab0ce",
"kind": "bulk-email",
"emails": [
{
"id": "em_01jnvnn9avq52k5mrhn1gab0ci",
"org_id": "org_01jh6jk82zjq9deye73h0mzcaq",
"status": "queued",
"kind": "email"
},
{
"id": "em_01jnvnn9avq52k5mrhn1gab0cj",
"org_id": "org_01jh6jk82zjq9deye73h0mzcaq",
"status": "queued",
"kind": "email"
},
{
"status": "rejected",
"error": "The domain is not verified",
"kind": "email"
}
]
}
}
Bearer HTTP authentication. Allowed headers Authorization: Bearer <API_KEY>
A successful response
The response is of type object
.