This commit is contained in:
Andras Bacsai
2023-06-01 13:24:20 +02:00
parent 0aa816b4f2
commit 6e094eaf42
10 changed files with 65 additions and 64 deletions

View File

@@ -15,8 +15,8 @@ class EmailChannel
{
$this->bootConfigs($notifiable);
if ($notification instanceof \App\Notifications\TestNotification) {
$bcc = $notifiable->routeNotificationForEmail('test_address');
if (count($bcc) === 1) {
$bcc = $notifiable->routeNotificationForEmail('test_notification_email');
if (count($bcc) === 0) {
$bcc = $notifiable->routeNotificationForEmail();
}
} else {
@@ -29,8 +29,8 @@ class EmailChannel
[],
fn (Message $message) => $message
->from(
$notifiable->smtp_attributes?->get('from_address'),
$notifiable->smtp_attributes?->get('from_name')
$notifiable->extra_attributes?->get('from_address'),
$notifiable->extra_attributes?->get('from_name')
)
->cc($bcc)
->bcc($bcc)
@@ -44,12 +44,12 @@ class EmailChannel
config()->set('mail.default', 'smtp');
config()->set('mail.mailers.smtp', [
"transport" => "smtp",
"host" => $notifiable->smtp_attributes?->get('smtp_host'),
"port" => $notifiable->smtp_attributes?->get('smtp_port'),
"encryption" => $notifiable->smtp_attributes?->get('smtp_encryption'),
"username" => $notifiable->smtp_attributes?->get('smtp_username'),
"password" => $notifiable->smtp_attributes?->get('smtp_password'),
"timeout" => $notifiable->smtp_attributes?->get('smtp_timeout'),
"host" => $notifiable->extra_attributes?->get('smtp_host'),
"port" => $notifiable->extra_attributes?->get('smtp_port'),
"encryption" => $notifiable->extra_attributes?->get('smtp_encryption'),
"username" => $notifiable->extra_attributes?->get('smtp_username'),
"password" => $notifiable->extra_attributes?->get('smtp_password'),
"timeout" => $notifiable->extra_attributes?->get('smtp_timeout'),
"local_domain" => null,
]);
}