mirror of
https://github.com/penpot/penpot.git
synced 2025-07-26 00:47:16 +02:00
🎉 Add automatic complaint and bouncing handling.
This commit is contained in:
parent
17229228a3
commit
7708752ad9
26 changed files with 1073 additions and 73 deletions
|
@ -40,14 +40,20 @@
|
|||
(s/keys :req-un [::email-1 ::email-2]))
|
||||
|
||||
(defn- on-error
|
||||
[form error]
|
||||
(cond
|
||||
(= (:code error) :email-already-exists)
|
||||
[form {:keys [code] :as error}]
|
||||
(case code
|
||||
:email-already-exists
|
||||
(swap! form (fn [data]
|
||||
(let [error {:message (tr "errors.email-already-exists")}]
|
||||
(assoc-in data [:errors :email-1] error))))
|
||||
|
||||
:else
|
||||
:profile-is-muted
|
||||
(rx/of (dm/error (tr "errors.profile-is-muted")))
|
||||
|
||||
:email-has-permanent-bounces
|
||||
(let [email (get @form [:data email])]
|
||||
(rx/of (dm/error (tr "errors.email-has-permanent-bounces" email))))
|
||||
|
||||
(rx/throw error)))
|
||||
|
||||
(defn- on-success
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue