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;
|
2023-12-03 14:07:47 +00:00
|
|
|
use Modules\Order\Entities\Order;
|
2023-06-11 12:14:03 +00:00
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
|
|
|
|
class NewOrder extends Mailable implements ShouldQueue
|
|
|
|
{
|
|
|
|
use Queueable, SerializesModels;
|
|
|
|
|
|
|
|
public $order;
|
|
|
|
|
2023-12-03 14:07:47 +00:00
|
|
|
|
2023-06-11 12:14:03 +00:00
|
|
|
/**
|
|
|
|
* Create a new message instance.
|
|
|
|
*
|
2023-12-03 14:07:47 +00:00
|
|
|
* @param Order $order
|
|
|
|
*
|
2023-06-11 12:14:03 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct($order)
|
|
|
|
{
|
|
|
|
$this->order = $order;
|
|
|
|
}
|
|
|
|
|
2023-12-03 14:07:47 +00:00
|
|
|
|
2023-06-11 12:14:03 +00:00
|
|
|
/**
|
|
|
|
* 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,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2023-12-03 14:07:47 +00:00
|
|
|
|
2023-06-11 12:14:03 +00:00
|
|
|
private function getViewName()
|
|
|
|
{
|
|
|
|
return 'new_order' . (is_rtl() ? '_rtl' : '');
|
|
|
|
}
|
|
|
|
}
|