56 lines
1.4 KiB
PHP
56 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Core\Mail;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
use Illuminate\Support\Facades\Log;
|
|
use Illuminate\Support\Facades\Config;
|
|
|
|
class DailyReportMail extends Mailable
|
|
{
|
|
|
|
use Queueable, SerializesModels;
|
|
|
|
public $tries = 5;
|
|
public $timeout = 30;
|
|
|
|
protected $param;
|
|
|
|
|
|
public function __construct($param)
|
|
{
|
|
$this->param = $param;
|
|
}
|
|
|
|
public function build()
|
|
{
|
|
try {
|
|
|
|
$params = $this->param;
|
|
$mailSenderAddress = Config::get('app.mailSenderAddress');
|
|
|
|
/*echo view('emails.dailyReportMail', compact('params'));
|
|
die();*/
|
|
|
|
$to = 'yoy@extranetwork.com';
|
|
$bcc[] = 'burhan@extranetwork.com';
|
|
|
|
return $this->from($mailSenderAddress, 'Extranetwork')
|
|
->view('emails.dailyReportMail', compact('params'))
|
|
->to($to, 'Extranetwork')
|
|
->bcc($bcc)
|
|
->subject('Extranetwork Summary Report - '. $params['daily']['period']);
|
|
|
|
|
|
} catch (Exception $e) {
|
|
$message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
|
|
Log::error($message);
|
|
return output(['status' => -1, 'message' => $e->getMessage()]);
|
|
}
|
|
}
|
|
|
|
}
|