57 lines
1.4 KiB
PHP
57 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class PlaceOrder extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
public $data;
|
|
public $attachment;
|
|
public $package;
|
|
public $payment_log;
|
|
public $subject;
|
|
public $data_message;
|
|
/**
|
|
* Create a new message instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct($args)
|
|
{
|
|
$this->data = $args['data'];
|
|
$this->subject = $args['subject'];
|
|
$this->data_message = $args['message'];
|
|
$this->attachment = $args['attachment_list'];
|
|
$this->package = $args['package'];
|
|
$this->payment_log = $args['payment_log'];
|
|
}
|
|
|
|
/**
|
|
* Build the message.
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function build()
|
|
{
|
|
$mail = $this->from(get_static_option('site_global_email'), get_static_option('site_'.get_default_language().'_title'))
|
|
->subject($this->subject)
|
|
->view('mail.order');
|
|
|
|
if (!empty($this->attachment)){
|
|
foreach ($this->attachment as $field_name => $attached_file){
|
|
if (file_exists($attached_file)){
|
|
$mail->attach($attached_file);
|
|
}
|
|
}
|
|
}
|
|
|
|
return $mail;
|
|
|
|
}
|
|
}
|