1 | <?php |
||
2 | |||
3 | namespace App\Mail; |
||
4 | |||
5 | use App\Models\User; |
||
6 | use Illuminate\Bus\Queueable; |
||
7 | use Illuminate\Mail\Mailable; |
||
8 | use Illuminate\Queue\SerializesModels; |
||
9 | |||
10 | class AccountChange extends Mailable |
||
11 | { |
||
12 | use Queueable, SerializesModels; |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
13 | |||
14 | /** |
||
15 | * @var User |
||
16 | */ |
||
17 | public $user; |
||
18 | |||
19 | /** |
||
20 | * @var mixed |
||
21 | */ |
||
22 | private $siteEmail; |
||
23 | |||
24 | /** |
||
25 | * @var mixed |
||
26 | */ |
||
27 | private $siteTitle; |
||
28 | |||
29 | /** |
||
30 | * AccountChange constructor. |
||
31 | */ |
||
32 | public function __construct(User $user) |
||
33 | { |
||
34 | $this->user = $user; |
||
35 | $this->siteEmail = config('mail.from.address'); |
||
36 | $this->siteTitle = config('app.name'); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Build the message. |
||
41 | * |
||
42 | * |
||
43 | * @throws \Exception |
||
44 | */ |
||
45 | public function build(): static |
||
46 | { |
||
47 | return $this->from($this->siteEmail)->subject('Account Changed')->view('emails.accountChange')->with(['account' => $this->user->role->name, 'username' => $this->user->username, 'site' => $this->siteTitle]); |
||
48 | } |
||
49 | } |
||
50 |