Getting Started

The Mandrill API documentation structures their endpoints in multiple categories. Scala mandrill follows this structure in its API.

Creating requests

The core feature of Scala Mandrill is to create request entities that you can serialize to json and send to the mandrill api. For every request you need a MandrillApiKey.

import net.gutefrage.mandrill._
import net.gutefrage.mandrill.core._

val apiKey = MandrillApiKey("your-api-key")

With this API key you can construct a Mandrill instance.

val mandrill = Mandrill(apiKey)

The Mandrill instance provides instances for each Mandrill API category. For example the Messages Calls endpoint:

val sendTemplateBody = mandrill.
  // the Messages API
  messages.
  // the actual endpoint
  sendTemplate("my-template-slug").
  // configure the endpoint
  to("foo@bar.com")

Serialize requests

The Mandrill API expects a JSON body. Scala Mandrill provides json serializers for the following json libraries