As I have to send AMP emails in bulk, I am able to do it by creating a template for normal HTML emails in NodeJs. However, when I attempt to do it with the AMP createEmailTemplate function, it will not let me create an AMP template, and I have also found that AMP emails can be sent as raw emails, but not as bulk emails.
Check my code working code below to sending Bulk email (but not an AMP)
`
.post('/bulk/survey', async (req, res) => {
AWS.config.update({ accessKeyId: config.AWS_ACCESS_KEY_ID, secretAccessKey: config.AWS_SECRET_ACCESS_KEY, region: config.AWS_BUCKET_REGION });
const ses = new AWS.SESV2({ apiVersion: '2019-09-27' });
const EmailPayload =
{ "BulkEmailEntries": [{ "Destination": { "ToAddresses": ["se***rs@sc***ra.com"] }, "ReplacementEmailContent": { "ReplacementTemplate": { "ReplacementTemplateData": "{ 'name':'SK', 'favorite_animal':'Parrot' }" } }, }, { "Destination": { "ToAddresses": ["[email protected]"] }, "ReplacementEmailContent": { "ReplacementTemplate": { "ReplacementTemplateData": "{'name':'SK', 'favorite_animal':'Parrot}" } } }], "ConfigurationSetName": "AMP_Configuration_Set", "DefaultContent": { "Template": { "TemplateArn": "arn:aws:ses:us-east-1:***:template/Welcome3", "TemplateData": '{"name": "TestEmailPerson", "favorite_animal": "TestEmailAnimal"}', "TemplateName": "Welcome3" } }, "FromEmailAddress": "aveys@***p.com" };
ses.sendBulkEmail(EmailPayload, function (err, data) {
if (err) {
console.log(err, err.stack);
res.send(err)
}
else {
console.log(data); res.send(data)
}
});
})
`
Is there any way to send bulk AMP-templated emails in AWS SES?