A ColdBox Module for the Mandrill API to manage transactional email.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Master Branch Build Status

This is a ColdBox Module to use with the Mandrill API. See the Mandrill API Documentation for more information about the service.


  • Lucee 5.2+
  • ColdBox 4.3+
  • Java 8+


Install using CommandBox: box install mandrill

Within config/Coldbox.cfc add a module settings element named mandrill and define your Mandrill API key in apiKey. Optionally, the default endpoint base URL (https://mandrillapp.com/api/1.0/) may be overridden using endpointBaseUrl:

moduleSettings = {
    "mandrill" = {
        "apiKey" = "YOUR_API_KEY"


The Mandrill client will be instantiated and configured on ColdBox application startup. Inject it where needed, or request it by name. Here's how one might send a message from a ColdBox Handler:

var message = {
    "html": "<h1>Way To Go Donny!</h1><p>If you will it, Dude, it is no dream.</p>",
    "subject": "Over The Line",
    "from_email": "walter@domain.tld",
    "from_name": "Walter Sobchak",
    "to": [
            "email": "donny@domain.tld",
            "name": "Theodore Donald 'Donny' Kerabatsos"
            "email": "the_dude@domain.tld",
            "name": "The Dude"

It's important to note that the sender address for messages sent through Mandrill must match a verified domain. See the knowledge base article on this topic for more information.


This project is an attempt to mimic the official Mandrill libraries for Python and Node.js. All of the features of the Mandrill API aren't implemented yet. Here's a summary of the calls supported in this version:

/users/info Mandrill.users.info()

/messages/send Mandrill.messages.send(required struct message, boolean async, string ip_pool, string send_at)

/messages/send-template Mandrill.messages.send_template(required string template_name, required array template_content, required struct message, boolean async, string ip_pool, string send_at)

/rejects/list Mandrill.rejects.list(string email, boolean include_expired, string subaccount)

/rejects/add Mandrill.rejects.add(required string email, string comment, string subaccount)

/rejects/delete Mandrill.rejects.delete(required string email, string subaccount)

/whitelists/list Mandrill.whitelists.list(string email)

/whitelists/add Mandrill.whitelists.add(required string email, string comment)

/whitelists/delete Mandrill.whitelists.delete(required string email)


The package is configured such that tests can be executed within CommandCox using testbox run. Note that environment variables SERVER_HOST and SERVER_PORT can be set to configure the CFML engine used for testing.

By default, the REST calls to Mandrill are mocked. To run the tests against the live Mandrill service, define a valid Mandrill API key as an environment variable (MANDRILL_API_KEY) or a Java system property (mandrill.api.key). Also ensure that authDomain in the test spec configuration is verified and matches the API key.


See the LICENSE file for license rights and limitations (MIT).