使用Nodemailer的SES TRANSPORT发送AWS SES模板化电子邮件时遇到的问题。
在SES TRANSPORT Documentation中,
To use SES transport, set a aws.SES object as the value for SES property in Nodemailer transport options.
这是我的代码的样子。
transporter.sendMail({
ses: {
Destination: {
CcAddresses: [],
ToAddresses: 'recipient@example.com'
},
Source: 'sender@example.com' ,
Template: 'template_name' ,
TemplateData: JSON.stringify(data) ,
// optional extra arguments for SendRawEmail
Tags: [{
Name: 'tag name',
Value: 'tag value'
}]
}
}, (err, info) => {
console.log(info.envelope);
console.log(info.messageId);
});
这是我遇到的错误。
2019-08-12T17:03:38.210Z error: There were 3 validation errors:
* UnexpectedParameter: Unexpected key 'Destination' found in params
* UnexpectedParameter: Unexpected key 'Template' found in params
* UnexpectedParameter: Unexpected key 'TemplateData' found in params