-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace App\Mail; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Mail\Mailable; | ||
use Illuminate\Queue\SerializesModels; | ||
use App\Models\User; | ||
|
||
class StaffNoticeMail extends Mailable | ||
{ | ||
use Queueable, SerializesModels; | ||
|
||
private $mailSubject, $user, $textLines; | ||
|
||
/** | ||
* Create a new message instance. | ||
* | ||
* @param string $mailSubject | ||
* @param Endorsement $endorsement | ||
* @param array $textLines an array of markdown lines to add | ||
* @param string $contactMail optional contact e-mail to put in footer | ||
* @param string $actionUrl optinal action button url | ||
* @param string $actionText optional action button text | ||
* @param string $actionColor optional bootstrap button color override | ||
* @return void | ||
*/ | ||
public function __construct(string $mailSubject, User $user, array $textLines) | ||
{ | ||
$this->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, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |