clojure-postmark / README.markdown


clojure-postmark lets you talk to Postmark from Clojure.


Slap this in your project.clj :dependencies:

[postmark "1.1.0"]


First you need to load the postmark function:

;; In an (ns)
(:use [postmark.core :only (postmark)])

;; Outside an (ns)
(use '[postmark.core :only (postmark)])

Create a customized postmark function:

(def pm (postmark "YOUR_API_KEY" ""))

Now just call the function to send an email:

(pm {:to ""
     :subject "Your Noms"
     :text "I wants them."})

You can send to multiple addresses by using a seq for :to, but remember that Postmark's API won't let you send to more than twenty recipients at a time:

(pm {:to ["" ""]
     :subject "All of Your Noms"
     :text "I wants them."})

There are a few other keys you can use in the map you pass to the call:

(pm {:to ["" ""]
     :cc [""]
     :bcc [""]
     :subject "All of Your Noms"
     :text "I wants them."
     :html "I <b>wants</b> them."
     :tag "Noms"
     :reply-to ""})


If you just want to run a test you can use postmark-test without an API key instead of postmark:

(use '[postmark.core :only (postmark-test)])
(def pt (postmark-test ""))

(pt {:to ["" ""]
     :subject "Testing"
     :text "I might want your noms."})

Todo List

  • Automatically generate plain text body if you just pass an html body.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.