This commit is contained in:
paulwer 2024-03-17 08:43:40 +01:00
parent e443fb28ec
commit 522fbea475
4 changed files with 255 additions and 241 deletions

View File

@ -336,6 +336,10 @@ class NinjaMailerJob implements ShouldQueue
$this->mailer = 'mailgun';
$this->setMailgunMailer();
return $this;
case 'client_brevo':
$this->mailer = 'brevo';
$this->setBrevoMailer();
return $this;
case 'smtp':
$this->mailer = 'smtp';
$this->configureSmtpMailer();

View File

@ -130,18 +130,20 @@ class AppServiceProvider extends ServiceProvider
)
);
});
// Mailer::macro('brevo_config', function (string $key) {
// // @phpstan-ignore /** @phpstan-ignore-next-line **/
// Mail::setSymfonyTransport((new BrevoTransportFactory)->create(
// new Dsn(
// 'brevo+api',
// 'default',
// $key
// )
// ));
Mailer::macro('brevo_config', function (string $brevo_key) {
// @phpstan-ignore /** @phpstan-ignore-next-line **/
Mailer::setSymfonyTransport(
(new BrevoTransportFactory)->create(
new Dsn(
'brevo+api',
'default',
$brevo_key
)
)
);
// return $this;
// });
return $this;
});
}

View File

@ -564,6 +564,10 @@ class Email implements ShouldQueue
$this->mailer = 'mailgun';
$this->setMailgunMailer();
return $this;
case 'client_brevo':
$this->mailer = 'brevo';
$this->setBrevoMailer();
return $this;
case 'smtp':
$this->mailer = 'smtp';
$this->configureSmtpMailer();

430
composer.lock generated

File diff suppressed because it is too large Load Diff