Adds mandrill in the SilverStripe CMS

Installs: 19 998

Dependents: 0

Suggesters: 0

Security: 0

Stars: 17

Watchers: 5

Forks: 17

Open Issues: 0


4.0.0 2021-10-05 09:22 UTC

This package is auto-updated.

Last update: 2022-05-15 09:18:31 UTC


Build Status Scrutinizer Code Quality Code Coverage Build Status codecov.io

Latest Stable Version Latest Unstable Version Total Downloads License Monthly Downloads Daily Downloads


Use Mandrill in SilverStripe

Define in your .env file the following constant


or by defining the api key in your config.yml

    mandrill_api_key: "key3goes9here"

This module uses the official php sdk version 1.0.54 with a few tweaks.

You can also autoconfigure the module with the following constants in your .env file

# Will log emails in the temp folders
# Will disable sending (useful in development)
# Set app domain explicitly
# Also recommended to specify an explicit from

By defining the Api Key, the module will register a new mailer that will be used to send all emails.


This module create a new admin section that allows you to see results from your api calls right from the SilverStripe CMS without having to log into mandrillapp.com


From the Mandrill Admin, you can setup a webhook for your website. This webhook will be called and MandrillController will take care of handling all events for you.

By default, MandrillController will do nothing. Feel free to add your own extensions to MandrillController to define your own rules, like "Send an email to the admin when we receive a spam complaint".

MandrillController provides 4 extensions points:

  • updateHandleAnyEvent
  • updateHandleSyncEvent
  • updateHandleInboundEvent
  • updateHandleMessageEvent

It's recommended that you ensure requests are coming from Mailchimp Transactional rather than an imitator. Webhook authentication is disabled by default but you can enable webhook authentication through the config layer like so:

  webhook_auth_enabled: true

You'll need your webhook authentication key which you can view and reset from the (Webhooks)[https://mandrillapp.com/settings/webhooks] page in your account. Add your key using the config layer or .env file.

via config

  webhook_key: YOUR_KEY

via .env file


Swift Mailer 6

Swift Mailer 6 introduced quite a lot of breaking changes, make sure you are not using any of those:

  • added Swift_Transport::ping()
  • removed Swift_Mime_HeaderFactory, Swift_Mime_HeaderSet, Swift_Mime_Message, Swift_Mime_MimeEntity, and Swift_Mime_ParameterizedHeader interfaces
  • removed Swift_MailTransport and Swift_Transport_MailTransport
  • removed Swift_Encoding
  • removed the Swift_Transport_MailInvoker interface and Swift_Transport_SimpleMailInvoker class
  • removed the Swift_SignedMessage class
  • removed newInstance() methods everywhere
  • methods operating on Date header now use DateTimeImmutable object instead of Unix timestamp; Swift_Mime_Headers_DateHeader::getTimestamp()/setTimestamp() renamed to getDateTime()/setDateTime()
  • bumped minimum version to PHP 7.0
  • removed Swift_Validate and replaced by egulias/email-validator


Tested with SilverStripe 4.9+


LeKoala - thomas@lekoala.be