1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Mail; |
4
|
|
|
|
5
|
|
|
use App\Models\JobApplication; |
6
|
|
|
use App\Traits\ApiMailable; |
7
|
|
|
use Illuminate\Bus\Queueable; |
8
|
|
|
use Illuminate\Mail\Mailable; |
9
|
|
|
use Illuminate\Queue\SerializesModels; |
10
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue; |
11
|
|
|
|
12
|
|
|
class MicroReferenceMail extends Mailable implements ShouldQueue |
13
|
|
|
{ |
14
|
|
|
use Queueable, SerializesModels, ApiMailable; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* The application for which we need to make a reference check. |
18
|
|
|
* |
19
|
|
|
* @var \App\Models\JobApplication |
20
|
|
|
*/ |
21
|
|
|
public $application; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* If true, this is for the applicant's Director reference. |
25
|
|
|
* If false, this is for the applicant's secondary reference. |
26
|
|
|
* |
27
|
|
|
* @var boolean |
28
|
|
|
*/ |
29
|
|
|
public $is_director; |
30
|
|
|
|
31
|
|
|
|
32
|
|
|
|
33
|
|
|
public function __construct(JobApplication $application, bool $is_director) |
34
|
|
|
{ |
35
|
|
|
$this->application = $application; |
36
|
|
|
$this->is_director = $is_director; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Build the message. |
41
|
|
|
* |
42
|
|
|
* @return $this |
43
|
|
|
*/ |
44
|
|
|
public function build() |
45
|
|
|
{ |
46
|
|
|
return $this->subject('TODO') // TODO: |
47
|
|
|
->from(config('mail.from.address'), config('mail.from.name')) |
|
|
|
|
48
|
|
|
->to(config('mail.from.address'), 'WAITING FOR NAME') // TODO: |
49
|
|
|
->markdown('emails.micro_reference', [ |
50
|
|
|
'reference_name' => 'WAITING FOR FIELD', // TODO: waiting for new fields |
51
|
|
|
'homepage_url' => route('home'), // TODO: waiting for new route |
|
|
|
|
52
|
|
|
'applicant_name' => $this->application->applicant->user->full_name, |
53
|
|
|
]); |
54
|
|
|
} |
55
|
|
|
} |
56
|
|
|
|