FleetCart/Modules/Checkout/Mail/NewOrder.php

46 lines
1.0 KiB
PHP
Raw Normal View History

2023-06-11 12:14:03 +00:00
<?php
namespace Modules\Checkout\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Modules\Media\Entities\File;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class NewOrder extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;
public $order;
/**
* Create a new message instance.
*
* @param \Modules\Order\Entities\Order $order
* @return void
*/
public function __construct($order)
{
$this->order = $order;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->subject(trans('checkout::mail.new_order_subject'))
->view("emails.{$this->getViewName()}", [
'logo' => File::findOrNew(setting('storefront_mail_logo'))->path,
]);
}
private function getViewName()
{
return 'new_order' . (is_rtl() ? '_rtl' : '');
}
}