- Switch to Symfony Mailer from SwiftMailer

- Added CSSLSJ new API config
This commit is contained in:
Dave Mc Nicoll 2023-05-31 15:54:06 +00:00
parent fd95e8db91
commit 94fc8885cf
4 changed files with 20 additions and 4 deletions

View File

@ -4,12 +4,12 @@ use function DI\autowire, DI\create, DI\get;
use TheBugs\Email\EmailConfiguration,
TheBugs\Email\MailerInterface,
TheBugs\Email\SwiftMailer;
TheBugs\Email\SymfonyMailer;
return [
EmailConfiguration::class => function($c) {
$email = new EmailConfiguration( EmailConfiguration::AUTH_TYPE_SMTP );
$email->smtpHost = getenv('SMTP_HOST');
$email->smtpHost = getenv('SMTP_HOSTNAME');
$email->smtpPort = getenv('SMTP_PORT');
$email->smtpUsername = getenv('SMTP_USERNAME');
$email->smtpPassword = getenv('SMTP_PASSWORD');
@ -20,5 +20,5 @@ return [
return $email;
},
MailerInterface::class => autowire(SwiftMailer::class),
MailerInterface::class => autowire(SymfonyMailer::class),
];

View File

@ -22,6 +22,10 @@ DEFAULT_LOCAL = "fr_CA.UTF-8"
DEFAULT_TIME = "fr.UTF-8"
DEFAULT_TIME_FALLBACK = "french.UTF-8"
CSSLSJ_API_URL = "http://api-dev.cslsj.qc.ca"
CSSLSJ_API_USERNAME = "dev"
CSSLSJ_API_PASSWORD = "dev"
# MS Authentication
# MS_OAUTH_CLIENT_ID = ""
# MS_OAUTH_CLIENT_SECRET = ""

View File

@ -17,6 +17,14 @@ return [
'application_name' => "",
],
'api' => [
'auth' => [
'type' => \CSLSJ\Api\AuthType::AUTH_HEADER_BASIC,
'username' => getenv('CSSLSJ_API_USERNAME'),
'password' => getenv('CSSLSJ_API_PASSWORD'),
]
],
'ulmus' => [
'connections' => [
'default' => [

View File

@ -50,9 +50,13 @@ return [
};
},
CSLSJ\Api\Client::class => create(CSLSJ\Api\Client::class)->constructor(get('api.authentication'), getenv('CSSLSJ_API_URL')),
'api.authentication' => function ($c) { return $c->get('config')['api']['auth']; },
EmailConfiguration::class => function($c) {
$email = new EmailConfiguration( EmailConfiguration::AUTH_TYPE_SMTP );
$email->smtpHost = getenv('SMTP_HOST');
$email->smtpHost = getenv('SMTP_HOSTNAME');
$email->smtpPort = getenv('SMTP_PORT');
$email->smtpUsername = getenv('SMTP_USERNAME');
$email->smtpPassword = getenv('SMTP_PASSWORD');