fix: migrate db schema for smtp + discord

This commit is contained in:
Andras Bacsai
2023-07-27 21:26:15 +02:00
parent d0a85713d2
commit 9c393ff6bc
21 changed files with 382 additions and 238 deletions

View File

@@ -24,8 +24,8 @@ class EmailChannel
[],
fn (Message $message) => $message
->from(
data_get($notifiable, 'smtp.from_address'),
data_get($notifiable, 'smtp.from_name'),
data_get($notifiable, 'smtp_from_address'),
data_get($notifiable, 'smtp_from_name'),
)
->bcc($bcc)
->subject($mailMessage->subject)
@@ -35,19 +35,19 @@ class EmailChannel
private function bootConfigs($notifiable): void
{
$password = data_get($notifiable, 'smtp.password');
$password = data_get($notifiable, 'smtp_password');
if ($password) $password = decrypt($password);
config()->set('mail.default', 'smtp');
config()->set('mail.mailers.smtp', [
"transport" => "smtp",
"host" => data_get($notifiable, 'smtp.host'),
"port" => data_get($notifiable, 'smtp.port'),
"encryption" => data_get($notifiable, 'smtp.encryption'),
"username" => data_get($notifiable, 'smtp.username'),
"host" => data_get($notifiable, 'smtp_host'),
"port" => data_get($notifiable, 'smtp_port'),
"encryption" => data_get($notifiable, 'smtp_encryption'),
"username" => data_get($notifiable, 'smtp_username'),
"password" => $password,
"timeout" => data_get($notifiable, 'smtp.timeout'),
"timeout" => data_get($notifiable, 'smtp_timeout'),
"local_domain" => null,
]);
}
}
}

View File

@@ -13,7 +13,7 @@ class TransactionalEmailChannel
public function send(User $notifiable, Notification $notification): void
{
$settings = InstanceSettings::get();
if (data_get($settings, 'smtp.enabled') !== true) {
if (data_get($settings, 'smtp_enabled') !== true) {
return;
}
$email = $notifiable->email;
@@ -27,8 +27,8 @@ class TransactionalEmailChannel
[],
fn (Message $message) => $message
->from(
data_get($settings, 'smtp.from_address'),
data_get($settings, 'smtp.from_name')
data_get($settings, 'smtp_from_address'),
data_get($settings, 'smtp_from_name')
)
->to($email)
->subject($mailMessage->subject)
@@ -40,4 +40,4 @@ class TransactionalEmailChannel
{
set_transanctional_email_settings();
}
}
}