drewr / postal

Clojure email support
MIT License
587 stars 85 forks source link

setSubject is not setting charset #36

Closed terjesb closed 11 years ago

terjesb commented 11 years ago

Norwegian characters (æøå) in the subject are shown as "?" in Gmail. When used in the body, they are shown okay. Sending to Gmail through SendGrid.

skjermbilde 2013-09-11 kl 16 29 39

                           {:from from
                            :to email
                            :subject "Test æøå"
                            :charset "utf-8"
                            :body [{:type "text/html; charset=utf-8"
                                    :content "Test æøå"}]}))))

I built a local version that adds charset to the setSubject call:

https://github.com/terjesb/postal/commit/00529b1b299dae78591be2e105cb295cc0620f05

This fixes it for me. Not sure why all the other calls use charset and setSubject does not?

The existing tests still pass, but I haven't been able to make a test specifically for utf-8. Locally on OS X, the current tests seem to work with utf-8 as-is.

drewr commented 11 years ago

It's an oversight. Subject should definitely be covered. Sorry for taking so long to fix this, and thanks for the patch!