Skip to content

Commit

Permalink
Update config email
Browse files Browse the repository at this point in the history
  • Loading branch information
tanrax committed Sep 17, 2019
1 parent a44f945 commit e6b7e77
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject tadam "0.2.0"
(defproject tadam "0.2.1"
:description "First version"
:url "https://github.com/tadam-framework/tadam"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
Expand Down
29 changes: 15 additions & 14 deletions src/tadam/email.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
(defn send
"Add session in request"
[to subject content-html content-plain]
(send-message {:host (env :email-host)
:user (env :email-user)
:pass (env :email-pass)
:ssl (env :email-ssl)
:port (env :email-port)}
{:from (env :email-from)
:to to
:subject subject
:type "text/html; charset=utf-8"
:body [:alternative
{:type "text/plain;charset=utf-8"
:content (env content-plain)}
{:type "text/html;charset=utf-8"
:content content-html}]}))
(let [env-email (clojure.edn/read-string (:email env))]
(send-message {:host (:host env-email)
:user (:user env-email)
:pass (:pass env-email)
:ssl (:ssl env-email)
:port (:port env-email)}
{:from (:from env-email)
:to to
:subject subject
:type "text/html; charset=utf-8"
:body [:alternative
{:type "text/plain;charset=utf-8"
:content content-plain}
{:type "text/html;charset=utf-8"
:content content-html}]})))

0 comments on commit e6b7e77

Please sign in to comment.