adapt to laravel 9
This commit is contained in:
@@ -3,12 +3,11 @@
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\Core\Mail\MailTemplate;
|
||||
use App\Repositories\Core\DateTime;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailables\Address;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Spatie\MailTemplates\TemplateMailable;
|
||||
use App\Repositories\Shop\Customers;
|
||||
|
||||
|
||||
class ConfirmationCommande extends TemplateMailable
|
||||
{
|
||||
@@ -29,30 +28,13 @@ class ConfirmationCommande extends TemplateMailable
|
||||
$this->user = $user;
|
||||
$this->male = $user->gender == 1;
|
||||
$this->subject = $subject;
|
||||
$this->from[] = ['address' => 'boutique@jardinenvie.com','name' => 'Boutique JardinEnVie'];
|
||||
$this->reply_to = ['address' => 'boutique@jardinenvie.com','name' => 'Boutique JardinEnVie'];
|
||||
}
|
||||
|
||||
public static function getDataByUser($user_id)
|
||||
public function envelope()
|
||||
{
|
||||
$user = self::getUser($user_id);
|
||||
|
||||
return $user ? [
|
||||
'user' => $user->toArray(),
|
||||
'male' => $user->gender == 1,
|
||||
] : false;
|
||||
return new Envelope(
|
||||
from: new Address('boutique@jardinenvie.com', 'Boutique Jardin\'Envie'),
|
||||
subject: $this->subject,
|
||||
);
|
||||
}
|
||||
|
||||
public static function getUser($id)
|
||||
{
|
||||
return Customers::get($id);
|
||||
}
|
||||
|
||||
public function build()
|
||||
{
|
||||
$data = ['user' => $this->user];
|
||||
$template = $this->getTemplate();
|
||||
return $this->view($template, $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user