Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.

felixtriller/kirby-mandrill-driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Mandrill mail driver for Kirby

Release Issues License

The missing Mandrill mail driver for the awesome Kirby CMS by Bastian Allgeier.

Installation

Copy & Pasting

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
            ...

Git Submodule

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.'

Usage

$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.