From 395f50ef2a3a357af9ad29074d7d7233365d1556 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 31 Jul 2022 11:46:27 +0200 Subject: [PATCH] Added own staff notice mailable --- app/Mail/StaffNoticeMail.php | 47 +++++++++++++++++++ .../InactiveOnlineStaffNotification.php | 4 +- resources/views/mail/staffnotice.blade.php | 17 +++++++ 3 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 app/Mail/StaffNoticeMail.php create mode 100644 resources/views/mail/staffnotice.blade.php diff --git a/app/Mail/StaffNoticeMail.php b/app/Mail/StaffNoticeMail.php new file mode 100644 index 000000000..d70d9324a --- /dev/null +++ b/app/Mail/StaffNoticeMail.php @@ -0,0 +1,47 @@ +mailSubject = $mailSubject; + $this->user = $user; + $this->textLines = $textLines; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + return $this->subject($this->mailSubject)->markdown('mail.staffnotice', [ + 'textLines' => $this->textLines, + ]); + } +} diff --git a/app/Notifications/InactiveOnlineStaffNotification.php b/app/Notifications/InactiveOnlineStaffNotification.php index b5d1c4c78..d8b589016 100644 --- a/app/Notifications/InactiveOnlineStaffNotification.php +++ b/app/Notifications/InactiveOnlineStaffNotification.php @@ -2,7 +2,7 @@ namespace App\Notifications; -use App\Mail\WarningMail; +use App\Mail\StaffNoticeMail; use App\Models\Endorsement; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -56,7 +56,7 @@ public function toMail($notifiable) 'All admins and moderators in area in question has been notified.', ]; - return (new WarningMail('Unauthorized network logon recorded', $this->user, $textLines)) + return (new StaffNoticeMail('Unauthorized network logon recorded', $this->user, $textLines)) ->to($this->sendTo->pluck('email')); } diff --git a/resources/views/mail/staffnotice.blade.php b/resources/views/mail/staffnotice.blade.php new file mode 100644 index 000000000..867b2f91c --- /dev/null +++ b/resources/views/mail/staffnotice.blade.php @@ -0,0 +1,17 @@ +@component('mail::message') + +{{-- Greeting --}} +# Hello, + +{{-- Intro Lines --}} +@foreach ($textLines as $line) +{{ $line }} + +@endforeach + +{{-- Subcopy --}} +@slot('subcopy') +This is an automatically generated notice. If you think you received this by error, contact the staff. +@endslot + +@endcomponent \ No newline at end of file