The missing Mandrill mail driver for the awesome Kirby CMS by Bastian Allgeier.
If not already existing, add a new plugins
folder to your site
directory. Then copy or link this repositories whole content in a new kirby-mandrill-driver
folder there. Afterwards, your directory structure should look like this:
site/
plugins/
kirby-mandrill-driver/
kirby-mandrill-driver.php
...
If you are an advanced user and know your way around Git and you already use Git to manage you project, install this plugin by adding it as a Git submodule:
$ cd your/project/root
$ git submodule add https://github.com/felixtriller/kirby-mandrill-driver.git site/plugins/kirby-mandrill-driver
To update this plugin, all you need to do is to run these two Git commands:
$ cd your/project/root
$ git submodule update --remote site/plugins/kirby-mandrill-driver
$ git commit -am 'Updating Mandrill driver.'
$email = new Email(array(
'to' => 'to@example.com',
'from' => 'from@example.com',
'subject' => 'Yay, Kirby sends mails',
'body' => 'Hey, this is a test email!',
'service' => 'mandrill',
'options' => array(
'key' => 'YOUR-MANDRILL-API-KEY'
)
));
if ($email->send()) {
echo 'The email has been sent via Mandrill';
} else {
echo $email->error()->message();
}
See the Kirby docs for further details.