diff --git a/backend/src/app/email.clj b/backend/src/app/email.clj index 91563b4d95..43361039d9 100644 --- a/backend/src/app/email.clj +++ b/backend/src/app/email.clj @@ -106,17 +106,17 @@ (let [content-part (MimeBodyPart.) alternative-mpart (MimeMultipart. "alternative")] + (when-let [content (get body "text/plain")] + (let [text-part (MimeBodyPart.)] + (.setText text-part ^String content ^String charset) + (.addBodyPart alternative-mpart text-part))) + (when-let [content (get body "text/html")] (let [html-part (MimeBodyPart.)] (.setContent html-part ^String content (str "text/html; charset=" charset)) (.addBodyPart alternative-mpart html-part))) - (when-let [content (get body "text/plain")] - (let [text-part (MimeBodyPart.)] - (.setText text-part ^String content ^String charset) - (.addBodyPart alternative-mpart text-part))) - (.setContent content-part alternative-mpart) (.addBodyPart mixed-mpart content-part))