-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMTP metadata problems #22
Comments
when i removed "#^" it worked.. why is that? should the documentation be updated? |
Yes, that is a documentation bug. Clojure previously used #^{} for metadata. |
nope still doesn't cut it, only a clean map is what works for me.. (i thought it worked in development previously, but it used sendmail, which actually worked on my machine..) |
i've tested with both Clojure 1.3 and 1.4. Postal version 1.7.1 |
Ugh! You're right. This is due to a contribution that I didn't vet too well, and reveals a lack of test coverage. Let me work on fixing. |
After looking at it further and trying it myself, there doesn't seem to be an issue there. Can you give me a failing test case? |
In following code does only (ns postal-bug.core
(:require [postal.core :as postal]))
(defn send-message [message]
(postal/send-message ^{:host "email-smtp.us-east-1.amazonaws.com"
:ssl true }
message))
(def smtp-settings
{:host "email-smtp.us-east-1.amazonaws.com"
:ssl true })
(defn send-message2 []
(postal/send-message ^smtp-settings
{:from "foo@example.com"
:to "bar@example.com"
:subject "foo"
:body "bar"}))
(defn send-message3 []
(postal/send-message ^{:host "email-smtp.us-east-1.amazonaws.com"
:ssl true }
{:to "foo@example.com"
:from "bar@example.com"
:subject "foo"
:body "bar"}))
(defn -main [& args]
(send-message {:from "foo@example.com"
:to "bar@example.com"
:subject "foo"
:body "bar"})
(send-message2)
(send-message3)) |
oh! now i get it, the meta data is "attached" to the message, not to the function call.. |
but it's pretty uncommon to use different smtp settings per message within the same application, don't you think? maybe an example with a "global" smtp-settings var in the README would be appropriate? would've at least helped a newbie like me :P |
Sorry! Didn't know there was a misunderstanding of the meta usage. :-) It may not be common, but as a library it shouldn't dictate what people do. Perhaps you have a policy where you need to send out a batch of messages in a stream but for billing reasons they each need to go through a different provider. The server info is ancillary to the content of the message, so meta seems like a logical place. If you'd rather use the two-arity version, go right ahead! Thanks for using postal! |
…ddition to the metadata way drewr#22
I have problems to configure Postal for smtp. It seems like the metadata is stripped of.
Ignores the smtp settings and uses sendmail instead..
The text was updated successfully, but these errors were encountered: