Skip to content

Commit

Permalink
fix inizializzazione driver mail
Browse files Browse the repository at this point in the history
  • Loading branch information
madbob committed May 1, 2024
1 parent 751b212 commit 051d766
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions code/app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,17 @@ class AppServiceProvider extends ServiceProvider
*/
private function initMailing()
{
$mailer = env('MAIL_MAILER');

if ($mailer == 'sendinblue') {
Mail::extend('sendinblue', function () {
return (new SendinblueTransportFactory)->create(
new Dsn('sendinblue+api', 'default', config('services.sendinblue.key'))
);
});
}
else if ($mailer == 'scaleway') {
Mail::extend('scaleway', function () {
return (new ScalewayTransportFactory)->create(
new Dsn('scaleway+api', 'default', config('mail.mailers.scaleway.username'), config('mail.mailers.scaleway.password'))
);
});
}
Mail::extend('sendinblue', function () {
return (new SendinblueTransportFactory)->create(
new Dsn('sendinblue+api', 'default', config('services.sendinblue.key'))
);
});

Mail::extend('scaleway', function () {
return (new ScalewayTransportFactory)->create(
new Dsn('scaleway+api', 'default', config('mail.mailers.scaleway.username'), config('mail.mailers.scaleway.password'))
);
});
}

protected function getEventPayload($event): ?array
Expand Down

0 comments on commit 051d766

Please sign in to comment.