Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 12 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| ServiceCredentialRenewed | |
0.00% |
0 / 12 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| build | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Mail; |
| 4 | |
| 5 | use App\Models\Service; |
| 6 | use App\Models\User; |
| 7 | use Illuminate\Mail\Mailable; |
| 8 | |
| 9 | class ServiceCredentialRenewed extends Mailable |
| 10 | { |
| 11 | /** |
| 12 | * The concerned service. |
| 13 | * |
| 14 | * @var \App\Models\Service |
| 15 | */ |
| 16 | public $service; |
| 17 | |
| 18 | /** |
| 19 | * The user who did the action. |
| 20 | * |
| 21 | * @var \App\Models\User |
| 22 | */ |
| 23 | public $user; |
| 24 | |
| 25 | /** |
| 26 | * Create a new message instance. |
| 27 | * |
| 28 | * @param \App\Models\Service $service |
| 29 | * @param \App\Models\User $user |
| 30 | */ |
| 31 | public function __construct(Service $service, User $user) |
| 32 | { |
| 33 | $this->service = $service; |
| 34 | $this->user = $user; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Build the message. |
| 39 | * |
| 40 | * @return \Illuminate\Mail\Mailable |
| 41 | */ |
| 42 | public function build(): \Illuminate\Mail\Mailable |
| 43 | { |
| 44 | return $this->view('mail.service-renewed') |
| 45 | ->subject('!!! Warning !!!, New service credential have been generated !') |
| 46 | ->text('mail.service-renewed-plain') |
| 47 | ->with('appName', config('app.name')) |
| 48 | ->with('service', $this->service) |
| 49 | ->with('by', sprintf('%s %s (%s)', $this->user->first_name, $this->user->last_name, $this->user->email)) |
| 50 | ->to( |
| 51 | config('mail.contactsList.serviceweb', 'equipe.web@ldc.fr'), |
| 52 | sprintf('%s service warning', config('app.name')) |
| 53 | ); |
| 54 | } |
| 55 | } |