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