diff options
| author | yo momma <shutup@oops.wtf> | 2026-02-04 19:33:57 +0000 |
|---|---|---|
| committer | yo momma <shutup@oops.wtf> | 2026-02-04 19:33:57 +0000 |
| commit | de9b7c3536a28c2b1bda458e16efb492d1efabcd (patch) | |
| tree | 0b687a064bddd6d3846e0f32a4486787e6192b6d /src | |
| parent | 75cf2a9c3cd925d2d8de4b5ef98bdd55c29e9861 (diff) | |
Rebrand: remove dump wording; env SMTP creds
Diffstat (limited to 'src')
| -rwxr-xr-x | src/email.clj | 29 |
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))) |
