import Nuntly from '@nuntly/sdk';
const client = new Nuntly({
apiKey: process.env['NUNTLY_API_KEY'], // This is the default and can be omitted
});
const content = await client.emails.content.retrieve('em_01ka8k8s80gvx9604cn9am5st4');
console.log(content.html);{
"data": {
"html": {
"downloadUrl": "<string>",
"size": 123,
"expiresAt": "<string>"
},
"text": {
"downloadUrl": "<string>",
"size": 123,
"expiresAt": "<string>"
},
"mime": {
"downloadUrl": "<string>",
"size": 123,
"expiresAt": "<string>"
},
"subjectTemplate": {
"downloadUrl": "<string>",
"size": 123,
"expiresAt": "<string>"
},
"htmlTemplate": {
"downloadUrl": "<string>",
"size": 123,
"expiresAt": "<string>"
},
"textTemplate": {
"downloadUrl": "<string>",
"size": 123,
"expiresAt": "<string>"
}
}
}Returns presigned URLs to download the HTML, plain-text, and raw MIME source of a sent email.
import Nuntly from '@nuntly/sdk';
const client = new Nuntly({
apiKey: process.env['NUNTLY_API_KEY'], // This is the default and can be omitted
});
const content = await client.emails.content.retrieve('em_01ka8k8s80gvx9604cn9am5st4');
console.log(content.html);{
"data": {
"html": {
"downloadUrl": "<string>",
"size": 123,
"expiresAt": "<string>"
},
"text": {
"downloadUrl": "<string>",
"size": 123,
"expiresAt": "<string>"
},
"mime": {
"downloadUrl": "<string>",
"size": 123,
"expiresAt": "<string>"
},
"subjectTemplate": {
"downloadUrl": "<string>",
"size": 123,
"expiresAt": "<string>"
},
"htmlTemplate": {
"downloadUrl": "<string>",
"size": 123,
"expiresAt": "<string>"
},
"textTemplate": {
"downloadUrl": "<string>",
"size": 123,
"expiresAt": "<string>"
}
}
}