first commit
This commit is contained in:
60
app/Core/Mail/InventoryPdfLinkMail.php
Normal file
60
app/Core/Mail/InventoryPdfLinkMail.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?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 InventoryPdfLinkMail 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');
|
||||
|
||||
app('translator')->setLocale(fillOnUndefined($params, 'locale', 'en'));
|
||||
|
||||
$params['title'] = $params['propertyName'] . ' - ' . __('enw-inventory-mail-pdf-link');
|
||||
$params['channelContact'] = $params['channelContact'];
|
||||
|
||||
if(empty($params['channelContact'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*echo view('emails.inventoryActionMail', compact('params'));
|
||||
die();*/
|
||||
|
||||
return $this->from($mailSenderAddress, 'Extranetwork - '.$params['propertyName'])
|
||||
->view('emails.inventoryPdfLinkMail', compact('params'))
|
||||
//->to($logMailAddress, 'Development Team')
|
||||
->bcc($params['channelContact'])
|
||||
->subject($params['title']);
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
$message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
|
||||
Log::error($message);
|
||||
return output(['status' => -1, 'message' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user