0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-09 16:48:16 -05:00

🎉 Add srepl helper for sending test email

This commit is contained in:
Andrey Antukh 2022-09-20 13:41:40 +02:00
parent 58319d84ad
commit 3c2ba92f6c

View file

@ -14,14 +14,11 @@
[app.srepl.helpers :as h]
[clojure.pprint :refer [pprint]]))
;; Empty namespace as main entry point for Server REPL
(defn print-available-tasks
[system]
(let [tasks (:app.worker/registry system)]
(p/pprint (keys tasks) :level 200)))
(defn run-task!
([system name]
(run-task! system name {}))
@ -29,4 +26,11 @@
(let [tasks (:app.worker/registry system)]
(if-let [task-fn (get tasks name)]
(task-fn params)
(l/warn :hint "no task found" :name name)))))
(println (format "no task '%s' found" name))))))
(defn send-test-email!
[system destination]
(let [handler (:app.emails/sendmail system)]
(handler {:body "test email"
:subject "test email"
:to [destination]})))