Issues (367)

app/Mail/ExportReady.php (5 issues)

1
<?php
2
3
namespace App\Mail;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Mail\Mailable;
7
use Illuminate\Queue\SerializesModels;
8
use Illuminate\Contracts\Queue\ShouldQueue;
9
10
class ExportReady extends Mailable
11
{
12
    use Queueable, SerializesModels;
0 ignored issues
show
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Mail\ExportReady: $id, $relations, $class, $keyBy
Loading history...
13
14
    /**
15
     * Create a new message instance.
16
     *
17
     * @return void
18
     */
19
    public function __construct($user)
20
    {
21
        $this->user = $user;
0 ignored issues
show
Bug Best Practice introduced by
The property user does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
22
        $this->subject = 'The DoE data is ready to download '. date('Y:m:d H:i:s');
23
        $this->from_address = env('MAIL_FROM_ADDRESS');
0 ignored issues
show
Bug Best Practice introduced by
The property from_address does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
24
        $this->from_name = 'SIS Bulk Uploader';
0 ignored issues
show
Bug Best Practice introduced by
The property from_name does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
25
        $this->with = [
0 ignored issues
show
Bug Best Practice introduced by
The property with does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
26
            'name' => $this->user->first_name,
27
            'link' => \App::environment('local') || \App::environment('stage')   ?  env('APP_URL').'/downloadExportexamination' : env('APP_URL').'/bulk-upload/downloadExportexamination'
28
        ];
29
30
        $this->viewData = [
31
            'name'=>$this->user->first_name, "body" =>'Your requested file is ready to download',
32
            'link' => \App::environment('local') || \App::environment('stage')   ?  env('APP_URL').'/downloadExportexamination' : env('APP_URL').'/bulk-upload/downloadExportexamination'
33
        ];
34
    }
35
36
    /**
37
     * Build the message.
38
     *
39
     * @return $this
40
     */
41
    public function build()
42
    {
43
        return $this->view('emails.mail')
44
            ->from($this->from_address,$this->from_name)
45
            ->to($this->user->email)
46
            ->subject($this->subject)
47
            ->with($this->with);
48
    }
49
}
50