Forked from cljmailgun, mailsling is a simple wrapper around the Mailgun REST API.
Add the following to the
:dependencies
vector of your project.clj
file:
[]
(https://clojars.org/mailsling)
.. and shooting them to selected targets:
(use 'mail.sling)
(def credentials {:domain "app81369673.mailgun.org"}) ; :api-key can also be set
When credentials
are provided via environment variables MAILGUN_API_KEY
and
MAILGUN_APP_DOMAIN
, with-sling
can be skipped, and shootmail
can be used
standalone. In this case, credentials
provided by environment variables will
be used instead:
(defn shoot-noreply-mail [params]
(shootmail (assoc params :from "noreply@fortune500.com")))
Because sending emails is side-effecty, with-sling
can be quite convenient
with multiple email tasks:
(let [params {:subject "work" :text "do this work now!" :to "minion@fortune500.com"}]
(with-sling credentials
(shootmail (assoc params :from "me@fortune500.com"))
(shoot-noreply-mail params)))
- Omar Yasin Author of cljmailgun
- Carlos Cunha Author of the fork
Copyright (C) 2015 Carlos C. Fontes.
Licensed under the MIT License.