Skip to content

reusle/mailsling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mailsling

Forked from cljmailgun, mailsling is a simple wrapper around the Mailgun REST API.

Holding mailsling with your hands!


Sogeking powerfully holding his slingshot Add the following to the :dependencies vector of your project.clj file: [clojars version] (https://clojars.org/mailsling)

Aiming targets with correspondence


.. 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)))

Gentle contributions


License


Copyright (C) 2015 Carlos C. Fontes.

Licensed under the MIT License.

About

Clojure Mailgun.org wrapper

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •