ldc-com-app-bo/app/Mail/AccountCreated.php

41 lines
812 B
PHP
Raw Normal View History

2023-07-13 08:34:54 +00:00
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class AccountCreated extends Mailable
{
use Queueable;
use SerializesModels;
2025-05-20 16:20:23 +02:00
/** @var object */
public $data;
2023-07-13 08:34:54 +00:00
/**
* Create a new message instance.
*
2025-05-20 16:20:23 +02:00
* @param mixed $data
2023-07-13 08:34:54 +00:00
* @return void
*/
2025-05-20 16:20:23 +02:00
public function __construct(mixed $data)
2023-07-13 08:34:54 +00:00
{
2025-05-20 16:20:23 +02:00
$this->data = (object) $data;
2023-07-13 08:34:54 +00:00
}
/**
* Build the message.
*
* @return mixed
2023-07-13 08:34:54 +00:00
*/
public function build(): mixed
2023-07-13 08:34:54 +00:00
{
2025-05-20 16:20:23 +02:00
return $this
->from($this->data->email, sprintf('%s %s', $this->data->lastname, $this->data->firstname))
->subject(__("Votre compte a été créé"))
->markdown('bo.mails.account-created');
2023-07-13 08:34:54 +00:00
}
}