summaryrefslogtreecommitdiff
path: root/src/email.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/email.clj')
-rwxr-xr-xsrc/email.clj29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/email.clj b/src/email.clj
index 6c09115..dded4a6 100755
--- a/src/email.clj
+++ b/src/email.clj
@@ -1,7 +1,8 @@
(ns email
(:import org.antlr.stringtemplate.StringTemplateGroup)
(:require [clojure.contrib.str-utils2 :as s])
- (:use utils))
+ (:use utils
+ config))
(defn base-mail [& m]
(let [mail (apply hash-map m)
@@ -55,16 +56,16 @@
"text/html"
"text/plain"))
-(defn dump-mail [to subject text]
- (base-mail :user "info@hump.fm"
- :password "UHR4Moghu5a2"
- :host "smtpout.secureserver.net"
- :port 465
- :ssl true
- :to [(join to ",")]
- :subject subject
- :text text
- :mime (classify-mimetype text)))
+(defn hump-mail [to subject text]
+ (base-mail :user (getenv "HUMPFM_SMTP_USER" "info@hump.fm")
+ :password (getenv "HUMPFM_SMTP_PASSWORD" "")
+ :host (getenv "HUMPFM_SMTP_HOST" "smtpout.secureserver.net")
+ :port (getenv-int "HUMPFM_SMTP_PORT" 465)
+ :ssl (getenv-bool "HUMPFM_SMTP_SSL" true)
+ :to [(join to ",")]
+ :subject subject
+ :text text
+ :mime (classify-mimetype text)))
(def *admin-lists* {"humpfmprod" ["info@hump.fm"]
"sostler" ["sbostler@gmail.com"]
@@ -78,12 +79,12 @@
([nick email] (send-registration-email nick email "welcome"))
([nick email temp]
(let [[s b] (parse-mail-template temp {"nick" nick})]
- (dump-mail [email] s b))))
+ (hump-mail [email] s b))))
(defn send-reset-email
([nick email link temp]
(let [[s b] (parse-mail-template temp {"nick" nick "link" link})]
- (dump-mail [email] s b)))
+ (hump-mail [email] s b)))
([nick email link] (send-reset-email nick email link "reset")))
(defn send-mute-email [user-nick admin-nick reason duration]
@@ -91,5 +92,5 @@
user-nick admin-nick duration)
body (format "Reason: %s"
reason)]
- (dump-mail (get-admins) subject body)))
+ (hump-mail (get-admins) subject body)))