diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-01-29 11:07:42 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-01-29 11:07:42 -0500 |
commit | 0371acff89b14b9bdcb03e72fd9637e26e6b517c (patch) | |
tree | f5878c9c07705379d137843cb8f92e3cdf7c20a8 /doc/en_US/plugin-mail-transports.markdown | |
parent | 3bf4789be255650b64f42231f41383cb13b65572 (diff) |
Move English documentation to folder en_US
Diffstat (limited to 'doc/en_US/plugin-mail-transports.markdown')
-rw-r--r-- | doc/en_US/plugin-mail-transports.markdown | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/doc/en_US/plugin-mail-transports.markdown b/doc/en_US/plugin-mail-transports.markdown new file mode 100644 index 00000000..33ce5e3b --- /dev/null +++ b/doc/en_US/plugin-mail-transports.markdown @@ -0,0 +1,50 @@ +Plugin: Add Mail Transport +========================== + +By default Kanboard supports 3 standards mail transports: + +- Mail (PHP mail function) +- Smtp +- Sendmail command + +With the plugin API you can add a driver for any email provider. +For example, your plugin can add a mail transport for a provider that uses an HTTP API. + +Implementation +-------------- + +Your plugin must implement the interface `Kanboard\Core\Mail\ClientInterface` and extends from `Kanboard\Core\Base`. + +The only method you need to implement is `sendEmail()`: + +```php +interface ClientInterface +{ + /** + * Send a HTML email + * + * @access public + * @param string $email + * @param string $name + * @param string $subject + * @param string $html + * @param string $author + */ + public function sendEmail($email, $name, $subject, $html, $author); +} +``` + +To register your new mail transport, use the method `setTransport($transport, $class)` from the class `Kanboard\Core\Mail\Client`: + +```php +$this->emailClient->setTransport('myprovider', '\Kanboard\Plugin\MyProvider\MyEmailHandler'); +``` + +The second argument contains the absolute name space of your concrete class. + +Examples of mail transport plugins +---------------------------------- + +- [Sendgrid](https://github.com/kanboard/plugin-sendgrid) +- [Mailgun](https://github.com/kanboard/plugin-mailgun) +- [Postmark](https://github.com/kanboard/plugin-postmark) |