lean/meta/definitions/email.php
Dave Mc Nicoll 01bb926ca7 - Added a new Email defintion (which will soon see it's components changed)
- Added a new post-install script for composer which adds a project skeleton "ready to use".
- Error 500 are now handled properly in production; waiting to see if adjustements will be required before adding other code pages.
2021-03-01 16:01:27 +00:00

25 lines
793 B
PHP

<?php
use function DI\autowire, DI\create, DI\get;
use TheBugs\Email\EmailConfiguration,
TheBugs\Email\MailerInterface,
TheBugs\Email\SwiftMailer;
return [
EmailConfiguration::class => function($c) {
$email = new EmailConfiguration( EmailConfiguration::AUTH_TYPE_SMTP );
$email->smtpHost = getenv('SMTP_HOST');
$email->smtpPort = getenv('SMTP_PORT');
$email->smtpUsername = getenv('SMTP_USERNAME');
$email->smtpPassword = getenv('SMTP_PASSWORD');
$email->smtpUseTLS = getenv('SMTP_TLS');
$email->toAddress = getenv("TO_EMAIL");
$email->fromAddress = getenv("FROM_EMAIL");
$email->fromName = getenv("FROM_NAME");
return $email;
},
MailerInterface::class => autowire(SwiftMailer::class),
];