diff options
| author | sostler <sbostler@gmail.com> | 2010-04-06 21:45:45 -0400 |
|---|---|---|
| committer | sostler <sbostler@gmail.com> | 2010-04-06 21:45:45 -0400 |
| commit | dddb984c918379c145193ad7426454f354c5eaa9 (patch) | |
| tree | 9ed668100f4ae270bd6142c97dad68e4bff0227e /src/email.clj | |
| parent | 921f247b0109e854e359865330c652a0a1f16616 (diff) | |
Added debug email page; removed useless to-array
Diffstat (limited to 'src/email.clj')
| -rw-r--r-- | src/email.clj | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/email.clj b/src/email.clj index 2a68e7b..47d05a8 100644 --- a/src/email.clj +++ b/src/email.clj @@ -37,7 +37,8 @@ (.setText msg (:text mail)) (javax.mail.Transport/send msg)))) -(def mail-templates (new StringTemplateGroup "dumpfm-mail" "template/mail")) +(def mail-templates (StringTemplateGroup. "dumpfm-mail" "template/mail" )) +;;(.setErrorListener mail-templates StringTemplateGroup/DEFAULT_ERROR_LISTENER) (.setRefreshInterval mail-templates 3) (defn parse-mail-template [temp props] @@ -58,9 +59,11 @@ :subject subject :text text)) -(defn send-registration-email [nick email] - (let [[s b] (parse-mail-template "welcome" {"nick" nick})] - (dump-mail [email] s b))) +(defn send-registration-email + ([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)))) (defn send-reset-email [nick email key] (let [[s b] (parse-mail-template "reset" {"nick" nick "key" key})] |
