kalys / bamboo_ses

AWS SES adapter for Bamboo
MIT License
35 stars 24 forks source link

Punycode email domains, encode addresses with RFC1342 #21

Closed mtarnovan closed 4 years ago

mtarnovan commented 4 years ago

We recently switched from another provider to SES, only to discover that the former provider was transparently rewriting email headers and subjects to make them work with non-ascii chars.

This PR allows bamboo_ses to optionally rewrite addresses and the subject to use RFC1342 encoding, and to use punycode for the domain part of email addresses.

Note that this does not include docs changes.

kalys commented 4 years ago

I think PR changes are about renderer logic. And they should be here lib/bamboo/adapters/rfc2822_with_bcc.ex.

mtarnovan commented 4 years ago

I tried that first, but SesAdapter.prepare_address converts addresses to strings before rendering, so RFC2822WithBcc.render_address({name, email}) is never actually called.

kalys commented 4 years ago

https://github.com/kalys/bamboo_ses/commit/275c1e0f9e69adaf1bf023ab3a3d96c2e5f2d53e https://github.com/kalys/bamboo_ses/commit/90dfb41297be8656721108a7bbcca5d97b5031b8