🐛 Set proper order of email parts.

This commit is contained in:
Andrey Antukh 2020-11-11 14:48:01 +01:00
parent 1db1bd03f5
commit 0221cc06f8

View file

@ -209,11 +209,16 @@
subj (render-email-template-part :subj id context) subj (render-email-template-part :subj id context)
text (render-email-template-part :txt id context) text (render-email-template-part :txt id context)
html (render-email-template-part :html 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 {:subject subj
:body [{:type "text/html" :body [{:type "text/plain"
:content html} :content text}
{:type "text/plain" {:type "text/html"
:content text}]})) :content html}]}))
(s/def ::priority #{:high :low}) (s/def ::priority #{:high :low})
(s/def ::to (s/or :sigle ::us/email (s/def ::to (s/or :sigle ::us/email