summaryrefslogtreecommitdiff
path: root/app/ServiceProvider/MailProvider.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-05-28 17:42:45 -0400
committerFrederic Guillot <fred@kanboard.net>2016-05-28 17:42:45 -0400
commite6235afb2d17baf31b6f6d67a0a51ac51243b909 (patch)
treeebc2f1a44a19b723b21d7854028f93093468caf1 /app/ServiceProvider/MailProvider.php
parentd6c1c1ea33de6386fabe7c9546bfae1c38d3b9e7 (diff)
Added mail provider class
Diffstat (limited to 'app/ServiceProvider/MailProvider.php')
-rw-r--r--app/ServiceProvider/MailProvider.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/app/ServiceProvider/MailProvider.php b/app/ServiceProvider/MailProvider.php
new file mode 100644
index 00000000..685709e3
--- /dev/null
+++ b/app/ServiceProvider/MailProvider.php
@@ -0,0 +1,34 @@
+<?php
+
+namespace Kanboard\ServiceProvider;
+
+use Kanboard\Core\Mail\Client as EmailClient;
+use Pimple\Container;
+use Pimple\ServiceProviderInterface;
+
+/**
+ * Mail Provider
+ *
+ * @package Kanboard\ServiceProvider
+ * @author Frederic Guillot
+ */
+class MailProvider implements ServiceProviderInterface
+{
+ /**
+ * Registers services on the given container.
+ *
+ * @param Container $container
+ */
+ public function register(Container $container)
+ {
+ $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;
+ };
+
+ return $container;
+ }
+}