Make mail transports pluggable and move integrations to plugins

- Postmark: https://github.com/kanboard/plugin-postmark
- Mailgun: https://github.com/kanboard/plugin-mailgun
- Sendgrid: https://github.com/kanboard/plugin-sendgrid
This commit is contained in:
Frederic Guillot
2015-10-16 20:50:12 -04:00
parent 9c9ed02cd7
commit f99a3c501f
55 changed files with 652 additions and 1457 deletions

View File

@@ -20,9 +20,7 @@ There are several email transports available:
- SMTP
- Sendmail
- PHP native mail function
- Mailgun
- Postmark
- Sendgrid
- Other methods can be provided by external plugins: Postmark, Sendgrid and Mailgun
Server settings
---------------
@@ -77,63 +75,6 @@ This is the default configuration:
define('MAIL_TRANSPORT', 'mail');
```
### Mailgun HTTP API
You can use the HTTP API of Mailgun to send emails.
Configuration:
```php
// We choose "mailgun" as mail transport
define('MAIL_TRANSPORT', 'mailgun');
// Mailgun API key
define('MAILGUN_API_TOKEN', 'YOUR_API_KEY');
// Mailgun domain name
define('MAILGUN_DOMAIN', 'YOUR_DOMAIN_CONFIGURED_IN_MAILGUN');
// Be sure to use the sender email address configured in Mailgun
define('MAIL_FROM', 'sender-address-configured-in-mailgun@example.org');
```
### Postmark HTTP API
Postmark is a third-party email service.
If you already use the Postmark integration to receive emails in Kanboard you can use the same provider to send email too.
This system use their HTTP API instead of the SMTP protocol.
Here are the required settings for this configuration:
```php
// We choose "postmark" as mail transport
define('MAIL_TRANSPORT', 'postmark');
// Copy and paste your Postmark API token
define('POSTMARK_API_TOKEN', 'COPY HERE YOUR POSTMARK API TOKEN');
// Be sure to use the Postmark configured sender email address
define('MAIL_FROM', 'sender-address-configured-in-postmark@example.org');
```
### Sendgrid HTTP API
You can use the HTTP API of Sendgrid to send emails.
Configuration:
```php
// We choose "sendgrid" as mail transport
define('MAIL_TRANSPORT', 'sendgrid');
// Sendgrid username
define('SENDGRID_API_USER', 'YOUR_SENDGRID_USERNAME');
// Sendgrid password
define('SENDGRID_API_KEY', 'YOUR_SENDGRID_PASSWORD');
```
### The sender email address
By default, emails will use the sender address `notifications@kanboard.local`.