55 lines
1.4 KiB
PHP
55 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Models\Service;
|
|
use App\Models\User;
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
class ServiceCredentialRenewed extends Mailable
|
|
{
|
|
/**
|
|
* The concerned service.
|
|
*
|
|
* @var \App\Models\Service
|
|
*/
|
|
public $service;
|
|
|
|
/**
|
|
* The user who did the action.
|
|
*
|
|
* @var \App\Models\User
|
|
*/
|
|
public $user;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*
|
|
* @param \App\Models\Service $service
|
|
* @param \App\Models\User $user
|
|
*/
|
|
public function __construct(Service $service, User $user)
|
|
{
|
|
$this->service = $service;
|
|
$this->user = $user;
|
|
}
|
|
|
|
/**
|
|
* Build the message.
|
|
*
|
|
* @return \Illuminate\Mail\Mailable
|
|
*/
|
|
public function build(): \Illuminate\Mail\Mailable
|
|
{
|
|
return $this->view('mail.service-renewed')
|
|
->subject('!!! Warning !!!, New service credential have been generated !')
|
|
->text('mail.service-renewed-plain')
|
|
->with('appName', config('app.name'))
|
|
->with('service', $this->service)
|
|
->with('by', sprintf('%s %s (%s)', $this->user->first_name, $this->user->last_name, $this->user->email))
|
|
->to(
|
|
config('mail.contactsList.serviceweb', 'equipe.web@ldc.fr'),
|
|
sprintf('%s service warning', config('app.name'))
|
|
);
|
|
}
|
|
}
|