notifme / notifme-sdk

A Node.js library to send all kinds of transactional notifications.
https://notifme.github.io/www/
MIT License
1.94k stars 149 forks source link

Custom email headers #59

Closed adambowles closed 5 years ago

adambowles commented 5 years ago

If I want to supply a custom header, will I have to implement a custom email handler, or does SMTP provider have this functionality?

BDav24 commented 5 years ago

Hi, have you tried simply passing the header in your request?

notifmeSdk.send({
  email: {
    from: 'me@example.com',
    to: 'john@example.com',
    // ....,
    headers: {
      'x-my-custom-header': 'my-value'
    }
  }
})
adambowles commented 5 years ago

@BDav24 That doesn't work

image

BDav24 commented 5 years ago

Ho you meant in the "notification catcher" provider, then no, custom headers don't appear there. But they should work for real smtp providers.

adambowles commented 5 years ago

Ah great, I'll try that thanks

adambowles commented 5 years ago

Yep, that worked!