mirror of
https://github.com/penpot/penpot.git
synced 2025-03-16 01:31:22 -05:00
🐛 Fix email sending.
This commit is contained in:
parent
460019e01b
commit
b4790c89ce
4 changed files with 26 additions and 14 deletions
|
@ -47,6 +47,7 @@
|
|||
(s/def ::email-reply-to ::us/email)
|
||||
(s/def ::email-from ::us/email)
|
||||
(s/def ::smtp-host ::us/string)
|
||||
(s/def ::smtp-port ::us/integer)
|
||||
(s/def ::smtp-user (s/nilable ::us/string))
|
||||
(s/def ::smtp-password (s/nilable ::us/string))
|
||||
(s/def ::smtp-tls ::us/boolean)
|
||||
|
@ -70,6 +71,7 @@
|
|||
::email-reply-to
|
||||
::email-from
|
||||
::smtp-host
|
||||
::smtp-port
|
||||
::smtp-user
|
||||
::smtp-password
|
||||
::smtp-tls
|
||||
|
|
|
@ -254,7 +254,7 @@
|
|||
(let [data {:to (:email params)
|
||||
:name (:fullname params)}]
|
||||
(p/do!
|
||||
(emails/send! emails/register data)
|
||||
(emails/send! conn emails/register data)
|
||||
profile))))))
|
||||
|
||||
;; --- Mutation: Request Profile Recovery
|
||||
|
|
|
@ -102,6 +102,13 @@
|
|||
(cond-> row
|
||||
props (assoc :props (blob/decode props)))))
|
||||
|
||||
(defn- log-error
|
||||
[item err]
|
||||
(log/error "Unhandled exception on task '" (:name item)
|
||||
"' (retry:" (:retry-num item) ") \n"
|
||||
(with-out-str
|
||||
(.printStackTrace ^Throwable err (java.io.PrintWriter. *out*)))))
|
||||
|
||||
(defn- event-loop
|
||||
[{:keys [tasks] :as options}]
|
||||
(let [queue (:queue options "default")
|
||||
|
@ -114,9 +121,11 @@
|
|||
(-> (p/do! (handle-task tasks item))
|
||||
(p/handle (fn [v e]
|
||||
(if e
|
||||
(do
|
||||
(log-error item e)
|
||||
(if (>= (:retry-num item) max-retries)
|
||||
(mark-as-failed conn item e)
|
||||
(reschedule conn item e))
|
||||
(reschedule conn item e)))
|
||||
(mark-as-completed conn item))))
|
||||
(p/then' (constantly ::handled))))))))))
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
[clojure.tools.logging :as log]
|
||||
[cuerdas.core :as str]
|
||||
[postal.core :as postal]
|
||||
[vertx.core :as vc]
|
||||
[promesa.core :as p]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.config :as cfg]
|
||||
|
@ -48,7 +49,7 @@
|
|||
|
||||
(defn send-email
|
||||
[email]
|
||||
(p/future
|
||||
(vc/blocking
|
||||
(let [config (get-smtp-config cfg/config)
|
||||
result (if (:enabled config)
|
||||
(postal/send-message config email)
|
||||
|
|
Loading…
Add table
Reference in a new issue