From 0221cc06f8038a966bd23601893ad14be9a6eae2 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 11 Nov 2020 14:48:01 +0100 Subject: [PATCH] :bug: Set proper order of email parts. --- backend/src/app/util/emails.clj | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/backend/src/app/util/emails.clj b/backend/src/app/util/emails.clj index 0188ad824..2558c5207 100644 --- a/backend/src/app/util/emails.clj +++ b/backend/src/app/util/emails.clj @@ -209,11 +209,16 @@ subj (render-email-template-part :subj id context) text (render-email-template-part :txt id context) html (render-email-template-part :html id context)] + (when (or (not subj) + (not text) + (not html)) + (ex/raise :type :internal + :code :missing-email-templates)) {:subject subj - :body [{:type "text/html" - :content html} - {:type "text/plain" - :content text}]})) + :body [{:type "text/plain" + :content text} + {:type "text/html" + :content html}]})) (s/def ::priority #{:high :low}) (s/def ::to (s/or :sigle ::us/email