Mandrill is a transactional email API for MailChimp users. This library provides a API models and json (de)serializers.
There is already a scala library scamandrill. While this library as a lot more API models implemented it takes a more opinionated approach.
Scala Mandrill
provides
- Generic API models and provides parsers for different json libs. You choose.
- No Mandrill Email Client. It's up to the user which http library to use
In addition the API models are incomplete. We'll add more as the library evolves.
core
provides API models and helpers to create themplay-json
provides jsonReads
andWrites
instances for all modelstest-kit
provides scalacheck generators and arbitraries for all API models
Add the necessary dependencies to your build.sbt
libraryDependencies ++= Seq(
"net.gutefrage.mandrill" %% "mandrill-core" % "0.1.6",
"net.gutefrage.mandrill" %% "mandrill-play-json" % "0.1.6",
"net.gutefrage.mandrill" %% "mandrill-test-kit" % "0.1.6" % "test"
)
Mandrill API request bodies are constructed via a fluent interface.
import net.gutefrage.mandrill._
import net.gutefrage.mandrill.core._
val apiKey = MandrillApiKey("your-api-key")
val sendTemplateBody = Mandrill(apiKey)
.messages
.sendTemplate("my-template-slug")
.to("[email protected]")
For more information read the documentation
- Mandrill for a great API documentation
- Scamandrill as a source of inspiration
- Scala Cats for a great documentation and inspiration for a scala library build setup