forwardemail / email-templates

Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for @forwardemail, @ladjs, @cabinjs, @spamscanner, and @breejs.
https://forwardemail.net/docs/send-emails-with-node-js-javascript
MIT License
3.66k stars 339 forks source link

AWS SES Configuration set ignored #369

Closed AlexZeitler closed 5 years ago

AlexZeitler commented 5 years ago

I tried to send an E-Mail using SES transport.

My E-Mail is send correctly but the AWS Configuration set doesn't seem to be used.

I created headers:

const headers = {
  'X-SES-CONFIGURATION-SET': 'my-config-set',
};

This is how I send the email:

const email = new Email({message: {from}, headers, views, send: true, transport});
email
  .send({template, message: {to}, locals})
  .then(resolve)
  .catch(reject);

According to the docs, specifying the X-SES-CONFIGURATION-SET header should always work.

AlexZeitler commented 5 years ago

Solved it: the headers have to be specified when calling the send function:

const email = new Email({message: {from}, views, send: true, transport});
email
  .send({template, message: {to, headers}, locals})
  .then(resolve)
  .catch(reject);