Fix styling
This commit is contained in:
committed by
github-actions[bot]
parent
41fb6a1fc9
commit
d86274cc37
@@ -14,7 +14,7 @@ class DiscordChannel
|
||||
{
|
||||
$message = $notification->toDiscord($notifiable);
|
||||
$webhookUrl = $notifiable->routeNotificationForDiscord();
|
||||
if (!$webhookUrl) {
|
||||
if (! $webhookUrl) {
|
||||
return;
|
||||
}
|
||||
dispatch(new SendMessageToDiscordJob($message, $webhookUrl));
|
||||
|
||||
@@ -6,7 +6,6 @@ use Exception;
|
||||
use Illuminate\Mail\Message;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Log;
|
||||
|
||||
class EmailChannel
|
||||
{
|
||||
@@ -26,7 +25,7 @@ class EmailChannel
|
||||
fn (Message $message) => $message
|
||||
->to($recipients)
|
||||
->subject($mailMessage->subject)
|
||||
->html((string)$mailMessage->render())
|
||||
->html((string) $mailMessage->render())
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
@@ -50,9 +49,10 @@ class EmailChannel
|
||||
{
|
||||
if (data_get($notifiable, 'use_instance_email_settings')) {
|
||||
$type = set_transanctional_email_settings();
|
||||
if (!$type) {
|
||||
if (! $type) {
|
||||
throw new Exception('No email settings found.');
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
config()->set('mail.from.address', data_get($notifiable, 'smtp_from_address', 'test@example.com'));
|
||||
@@ -64,14 +64,14 @@ class EmailChannel
|
||||
if (data_get($notifiable, 'smtp_enabled')) {
|
||||
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'),
|
||||
"password" => data_get($notifiable, 'smtp_password'),
|
||||
"timeout" => data_get($notifiable, 'smtp_timeout'),
|
||||
"local_domain" => null,
|
||||
'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'),
|
||||
'password' => data_get($notifiable, 'smtp_password'),
|
||||
'timeout' => data_get($notifiable, 'smtp_timeout'),
|
||||
'local_domain' => null,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,5 +5,4 @@ namespace App\Notifications\Channels;
|
||||
interface SendsTelegram
|
||||
{
|
||||
public function routeNotificationForTelegram();
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class TelegramChannel
|
||||
$topicId = data_get($notifiable, 'telegram_notifications_scheduled_tasks_thread_id');
|
||||
break;
|
||||
}
|
||||
if (!$telegramToken || !$chatId || !$message) {
|
||||
if (! $telegramToken || ! $chatId || ! $message) {
|
||||
return;
|
||||
}
|
||||
dispatch(new SendMessageToTelegramJob($message, $buttons, $telegramToken, $chatId, $topicId));
|
||||
|
||||
@@ -15,12 +15,13 @@ class TransactionalEmailChannel
|
||||
public function send(User $notifiable, Notification $notification): void
|
||||
{
|
||||
$settings = InstanceSettings::get();
|
||||
if (!data_get($settings, 'smtp_enabled') && !data_get($settings, 'resend_enabled')) {
|
||||
if (! data_get($settings, 'smtp_enabled') && ! data_get($settings, 'resend_enabled')) {
|
||||
Log::info('SMTP/Resend not enabled');
|
||||
|
||||
return;
|
||||
}
|
||||
$email = $notifiable->email;
|
||||
if (!$email) {
|
||||
if (! $email) {
|
||||
return;
|
||||
}
|
||||
$this->bootConfigs();
|
||||
@@ -31,14 +32,14 @@ class TransactionalEmailChannel
|
||||
fn (Message $message) => $message
|
||||
->to($email)
|
||||
->subject($mailMessage->subject)
|
||||
->html((string)$mailMessage->render())
|
||||
->html((string) $mailMessage->render())
|
||||
);
|
||||
}
|
||||
|
||||
private function bootConfigs(): void
|
||||
{
|
||||
$type = set_transanctional_email_settings();
|
||||
if (!$type) {
|
||||
if (! $type) {
|
||||
throw new Exception('No email settings found.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user