Handle inbound mail with postmark
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ChangeLog
Postmark.scala
README.md
exampleWebHookAllFields.json

README.md

Postmark Mitt

Alt text

This set of case classes and their accompanying readers is meant to be used to help parse inbound mail with Postmark.

It is assumed to be used with the Play Framework for both parsing and validating the incoming JSON request, and as such, relies on two of Play's internal libraries.

An example use case for it might be as follows:

import models.Postmark

val source = scala.io.Source.fromFile("exampleWebHookAllFields.json")
val postMarkResult = Postmark.parseJson(source.mkString)

postMarkResult match {
  case s: JsSuccess[postMarkMitt] => val result = s.get
      // additional fields accessible as attributes off of result
      println(result.attachments.length.toString())
}