import Nuntly from '@nuntly/sdk';
const client = new Nuntly({
apiKey: process.env['NUNTLY_API_KEY'], // This is the default and can be omitted
});
const email = await client.emails.retrieve('em_01ka8k8s80gvx9604cn9am5st4');
console.log(email.id);{
"data": {
"id": "<string>",
"orgId": "<string>",
"from": "<string>",
"to": [
"<string>"
],
"status": "queued",
"subject": "<string>",
"createdAt": "<string>",
"messageId": "<string>",
"bulkId": "<string>",
"cc": [
"<string>"
],
"bcc": [
"<string>"
],
"statusReason": {},
"replyTo": [
"<string>"
],
"headers": {},
"tags": [
{
"name": "<string>",
"value": "<string>"
}
],
"attachments": [
{
"filename": "<string>",
"contentType": "<string>",
"size": 123
}
],
"context": {},
"scheduledAt": "<string>"
}
}Retrieve an email by its id
import Nuntly from '@nuntly/sdk';
const client = new Nuntly({
apiKey: process.env['NUNTLY_API_KEY'], // This is the default and can be omitted
});
const email = await client.emails.retrieve('em_01ka8k8s80gvx9604cn9am5st4');
console.log(email.id);{
"data": {
"id": "<string>",
"orgId": "<string>",
"from": "<string>",
"to": [
"<string>"
],
"status": "queued",
"subject": "<string>",
"createdAt": "<string>",
"messageId": "<string>",
"bulkId": "<string>",
"cc": [
"<string>"
],
"bcc": [
"<string>"
],
"statusReason": {},
"replyTo": [
"<string>"
],
"headers": {},
"tags": [
{
"name": "<string>",
"value": "<string>"
}
],
"attachments": [
{
"filename": "<string>",
"contentType": "<string>",
"size": 123
}
],
"context": {},
"scheduledAt": "<string>"
}
}