(ns src.backend.mailersend (:require [org.aplex.helpers.interface :as h] [ajax.core :refer [ajax-request]] [org.aplex.mailersend.interface :as m])) (def response (atom nil)) (-> {:to [{:email "olymk2@gmail.com" :name "oly"}] :from {:email "test@theplantscape.com" :name "test"} :subject "Test mailersend api" :text "Hi {$name}" :html "Hi {$name}" :variables [{:email "olymk2@gmail.com" :substitutions [{:var "name" :value "Test name"}]}]} (m/send-email) (h/attach-handler prn)) (-> {:email "olymk2@gmail.com"} (m/verify-email) (h/attach-handler (partial reset! response)) (ajax-request) (deref)) @response (-> {:to [{:email #_"test@theplantscape.com" "oly@digitaloctave.com" :name "oly"}] :from {:email "hello@theplantscape.com" :name "test"} :subject "Test mailersend api" :text "Hi {$name}" :html "Hi {$name}" #_:variables #_[{:email "olymk2@gmail.com" :substitutions [{:var "name" :value "Test name"}]}]} (m/send-email) (h/attach-handler (partial reset! response)) (ajax-request) (deref)) @response (-> (m/list-domains) (h/attach-handler (partial reset! response)) (ajax-request) (deref)) @response (-> (m/fetch-domain "jpzkmgqvynvl059v") (h/attach-handler (partial reset! response)) (ajax-request) (deref)) @response