Skip to content
Snippets Groups Projects
Commit 5ff354ee authored by Tom Robinson's avatar Tom Robinson
Browse files

Formatting cleanup

parent 7cd21618
No related branches found
No related tags found
No related merge requests found
......@@ -18,18 +18,17 @@
(defn send-new-user-email
"Format and Send an welcome email for newly created users."
[invited invitor join-url]
(let [data-quote (rand-nth q/quotations)
company (or (setting/get :site-name)
"Unknown")
message-body (->> {:invitedName (:first_name invited)
:invitorName (:first_name invitor)
:invitorEmail (:email invitor)
:company company
:joinUrl join-url
:quotation (:quote data-quote)
:quotationAuthor (:author data-quote)
:today (u/format-date "MMM' 'dd,' 'yyyy" (System/currentTimeMillis))}
(stencil/render-file "metabase/email/new_user_invite"))]
(let [data-quote (rand-nth q/quotations)
company (or (setting/get :site-name) "Unknown")
message-body (stencil/render-file "metabase/email/new_user_invite"
{:invitedName (:first_name invited)
:invitorName (:first_name invitor)
:invitorEmail (:email invitor)
:company company
:joinUrl join-url
:quotation (:quote data-quote)
:quotationAuthor (:author data-quote)
:today (u/format-date "MMM' 'dd,' 'yyyy" (System/currentTimeMillis))})]
(email/send-message
:subject (str "You're invited to join " company "'s Metabase")
:recipients [(:email invited)]
......@@ -43,9 +42,9 @@
(u/is-email? email)
(string? hostname)
(string? password-reset-url)]}
(let [message-body (->> {:hostname hostname
:passwordResetUrl password-reset-url}
(stencil/render-file "metabase/email/password_reset"))]
(let [message-body (stencil/render-file "metabase/email/password_reset"
{:hostname hostname
:passwordResetUrl password-reset-url})]
(email/send-message
:subject "[Metabase] Password Reset Request"
:recipients [email]
......@@ -65,17 +64,17 @@
(defn render-pulse-email
"Take a pulse object and list of results, returns an array of attachment objects for an email"
[pulse results]
(let [images (atom [])
render-img (fn [bytes] (reset! images (conj @images bytes)) (str "cid:IMAGE_" (-> @images count dec)))
body (apply vector :div (mapv (partial render-pulse-section render-img) results))
data-quote (rand-nth q/quotations)
message-body (->> {:pulse (html body)
:pulseName (:name pulse)
:sectionStype p/section-style
:colorGrey4 p/color-grey-4
:quotation (:quote data-quote)
:quotationAuthor (:author data-quote)}
(stencil/render-file "metabase/email/pulse"))]
(let [images (atom [])
render-img (fn [bytes] (reset! images (conj @images bytes)) (str "cid:IMAGE_" (-> @images count dec)))
body (apply vector :div (mapv (partial render-pulse-section render-img) results))
data-quote (rand-nth q/quotations)
message-body (stencil/render-file "metabase/email/pulse"
{:pulse (html body)
:pulseName (:name pulse)
:sectionStype p/section-style
:colorGrey4 p/color-grey-4
:quotation (:quote data-quote)
:quotationAuthor (:author data-quote)})]
(apply vector {:type "text/html" :content message-body}
(map-indexed (fn [idx bytes] {:type :inline
:content-id (str "IMAGE_" idx)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment