riemann.mailgun

Forwards events to Mailgun

mailgun

(mailgun)(mailgun opts)(mailgun mgun-opts msg-opts)

Returns a mailer, which is a function invoked with an address or a sequence of addresses and returns a stream. That stream is a function which takes a single event, or a sequence of events, and sends email about them.

By default, riemann uses (subject events) and (body events) to format emails. You can set your own subject or body formatter functions by including :subject or :body in msg-opts. These formatting functions take a sequence of events and return a string.

(def email (mailgun {} {:body (fn [events]
(apply prn-str events))}))

This api uses text body by default. If you want to use HTML body, you can set a body formatter function returns a map of fields :type and :content.