I am sending emails in JavaScript using the AWS SES SDK. I will have users calling this function and they need to know whether their emails were delivered successfully or not. This is my current code:
var aws = require("aws-sdk");
let credentials = aws.config.credentials;
aws.config.update({
region: "us-east-1",
});
// Specify a configuration set.
const configuration_set = "test";
const ses = new aws.SES();
var to = ['bounce@simulator.amazonses.com']
var from = 'tester@gmail.com'
const params = {
Source: from,
Destination: { ToAddresses: to },
Message: {
Subject: {
Data: "Sending emails through SES"
},
Body: {
Text: {
Data: 'Hello world www.google.ca',
}
}
},
ConfigurationSetName: configuration_set
};
ses.sendEmail(params, function (err, data) {
if (err) throw err
console.log(data)
//Do something here to check if email was delivered successfully
})
The data returned in the console is a RequestId and a MessageId. I have done research on if its possible to check the delivery status of an email using the MessageId but it does not seem like it is. Is there any other way I could let whoever calls this function know whether or not their email was delivered successfully or bounced/did not make it.