A Clojure Library for the Sendgrid API v3
clj-sendgrid is available in Clojars. Add this :dependency
to your Leiningen project.clj
:
[clj-sendgrid "0.1.2"]
Include in your namespace
(:require [sendgrid.core :as sg])
(def api-token "Bearer YOURTOKENVALUE")
(get-alerts api-token)
(get-bounces api-token)
(get-blocks api-token)
(get-invalid-emails api-token)
(get-spam-reports api-token)
(get-blocks api-token {:limit 1})
(send-email {:api-token api-token
:from [email protected]
:to [email protected]
:subject "Test Subject"
:message "Test Message"})
(send-email {:api-token api-token
:from [email protected]
:to [[email protected] [email protected]]
:subject "Test Subject"
:message "Test Message"})
(send-email {:api-token api-token
:from [email protected]
:to [email protected]
:subject "Test Subject"
:message "Test Message"
:filename "Test.txt"
:content (string->b64-string "Hello World)"})
https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html