45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class ReportExcel extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct($data)
|
|
{
|
|
$this->data = $data;
|
|
}
|
|
|
|
/**
|
|
* Build the message.
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function build()
|
|
{
|
|
if(!isset($this->data->sender_name) || $this->data->sender_name == '') {
|
|
$this->data->sender_name = 'Rapport Support';
|
|
}
|
|
if(!isset($this->data->sender_email) || $this->data->sender_email == '') {
|
|
$this->data->sender_email = 'support1@stratawiz.com';
|
|
}
|
|
return $this->view('email.reportexcel')
|
|
->from($this->data->sender_email, $this->data->sender_name)
|
|
->replyTo($this->data->sender_email, $this->data->sender_name)
|
|
->subject($this->data->subject)
|
|
->with('body', $this->data->body)
|
|
->attachData($this->data->attachment, $this->data->attachment_name);
|
|
}
|
|
}
|