1 | <?php |
||
2 | |||
3 | namespace App\Mail; |
||
4 | |||
5 | use App\Models\JobPosterStatusHistory; |
||
6 | use Illuminate\Bus\Queueable; |
||
7 | use Illuminate\Contracts\Queue\ShouldQueue; |
||
8 | use Illuminate\Mail\Mailable; |
||
9 | use Illuminate\Queue\SerializesModels; |
||
10 | |||
11 | class JobStatusChanged extends Mailable implements ShouldQueue |
||
12 | { |
||
13 | use Queueable, SerializesModels; |
||
14 | |||
15 | /** |
||
16 | * The job status transition which caused this notification. |
||
17 | * |
||
18 | * @var JobPosterStatusHistory |
||
19 | */ |
||
20 | protected $transition; |
||
21 | |||
22 | /** |
||
23 | * Create a new message instance. |
||
24 | * |
||
25 | * @return void |
||
26 | */ |
||
27 | public function __construct(JobPosterStatusHistory $transition) |
||
28 | { |
||
29 | $this->transition = $transition; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Build the message. |
||
34 | * |
||
35 | * @return $this |
||
36 | */ |
||
37 | public function build() |
||
38 | { |
||
39 | $job = $this->transition->job_poster; |
||
40 | $to = $this->transition->to->name; |
||
41 | $subject = "Job $job->title changed status to $to"; |
||
42 | return $this->markdown('emails.job_posters.status_transition') |
||
43 | ->subject($subject) |
||
44 | ->with([ |
||
45 | 'jobPoster' => $this->transition->job_poster, |
||
46 | 'user' => $this->transition->user, |
||
47 | 'from' => $this->transition->from->name, |
||
48 | 'to' => $to, |
||
49 | 'url' => backpack_url('job-poster'), |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
50 | ]); |
||
51 | } |
||
52 | } |
||
53 |