Passed
Push — feature/micro-ref-email ( 897999 )
by Tristan
05:32
created

MicroReferenceMail   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 13
c 1
b 0
f 0
dl 0
loc 41
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A build() 0 9 1
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'))
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

47
            ->from(/** @scrutinizer ignore-call */ config('mail.from.address'), config('mail.from.name'))
Loading history...
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
0 ignored issues
show
Bug introduced by
The function route was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

51
                'homepage_url' => /** @scrutinizer ignore-call */ route('home'), // TODO: waiting for new route
Loading history...
52
                'applicant_name' => $this->application->applicant->user->full_name,
53
            ]);
54
    }
55
}
56