From f99a3c501fd6ed7b4914b8d6e855489c2ce5b219 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Fri, 16 Oct 2015 20:50:12 -0400 Subject: 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 --- app/ServiceProvider/ClassProvider.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'app/ServiceProvider/ClassProvider.php') 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:'); -- cgit v1.2.3