diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-10-16 20:50:12 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-10-16 20:50:12 -0400 |
commit | f99a3c501fd6ed7b4914b8d6e855489c2ce5b219 (patch) | |
tree | 976276d6acfff78923e4549b0ef9ea94c5e2cb0d /app/ServiceProvider/ClassProvider.php | |
parent | 9c9ed02cd7ebc5dbbc99bcaed6f80988ce8a9677 (diff) |
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
Diffstat (limited to 'app/ServiceProvider/ClassProvider.php')
-rw-r--r-- | app/ServiceProvider/ClassProvider.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/ServiceProvider/ClassProvider.php b/app/ServiceProvider/ClassProvider.php index d91bced7..4acebfeb 100644 --- a/app/ServiceProvider/ClassProvider.php +++ b/app/ServiceProvider/ClassProvider.php @@ -3,6 +3,7 @@ namespace Kanboard\ServiceProvider; use Kanboard\Core\Plugin\Loader; +use Kanboard\Core\Mail\Client as EmailClient; use Kanboard\Core\ObjectStorage\FileStorage; use Kanboard\Core\Paginator; use Kanboard\Core\OAuth2; @@ -78,7 +79,6 @@ class ClassProvider implements ServiceProviderInterface 'ProjectGanttFormatter', ), 'Core' => array( - 'EmailClient', 'Helper', 'HttpClient', 'Lexer', @@ -99,11 +99,7 @@ class ClassProvider implements ServiceProviderInterface 'GitlabWebhook', 'HipchatWebhook', 'Jabber', - 'Mailgun', - 'Postmark', - 'Sendgrid', 'SlackWebhook', - 'Smtp', ) ); @@ -127,6 +123,14 @@ class ClassProvider implements ServiceProviderInterface return new FileStorage(FILES_DIR); }; + $container['emailClient'] = function($container) { + $mailer = new EmailClient($container); + $mailer->setTransport('smtp', '\Kanboard\Core\Mail\Transport\Smtp'); + $mailer->setTransport('sendmail', '\Kanboard\Core\Mail\Transport\Sendmail'); + $mailer->setTransport('mail', '\Kanboard\Core\Mail\Transport\Mail'); + return $mailer; + }; + $container['pluginLoader'] = new Loader($container); $container['cspRules'] = array('style-src' => "'self' 'unsafe-inline'", 'img-src' => '* data:'); |