pablo-co / bamboo_postmark

A Bamboo adapter for Postmark
MIT License
39 stars 29 forks source link

Quoting recipient names with punctuation #32

Open ukutaht opened 4 years ago

ukutaht commented 4 years ago

First of all, thanks for the library.

I have a problem sending email to one of my customers who has included punctuation in their username. I use the to: [{user_name, user_email}] format to configure the recipient.

When the first field includes a comma e.g. acme, Inc, the postmark API returns the following error:

Here is the response:
"{\"ErrorCode\":300,\"Message\":\"Error parsing 'To': Illegal email address 'acme'. It must contain the '@' symbol.\"}"

Postmark's documentation states that

For email addresses that have names or titles with punctuation, you should quote them as such: "To" : "\"Joe Receiver, jr\" receiver@example.com"

ref

Do you think adding quote marks around the name of the recipient is within scope of this library?

Cheers

vinibrsl commented 2 years ago

I have a pull request that might solve this issue: https://github.com/pablo-co/bamboo_postmark/pull/41