2020-05-28 05:08:13 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Mail;
|
|
|
|
|
|
|
|
use Carbon\Carbon;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
2022-09-29 02:16:08 +00:00
|
|
|
use Illuminate\Support\Facades\Config;
|
2020-05-28 05:08:13 +00:00
|
|
|
|
2022-04-20 06:24:58 +00:00
|
|
|
use App\Models\{Supplier,Site};
|
2020-05-28 05:08:13 +00:00
|
|
|
|
|
|
|
class TrafficMismatch extends Mailable
|
|
|
|
{
|
|
|
|
use Queueable, SerializesModels;
|
|
|
|
|
2022-04-20 06:24:58 +00:00
|
|
|
public Supplier $aso;
|
2021-09-29 06:20:22 +00:00
|
|
|
public Carbon $date;
|
|
|
|
|
2020-05-28 05:08:13 +00:00
|
|
|
/**
|
|
|
|
* Create a new message instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2022-04-20 06:24:58 +00:00
|
|
|
public function __construct(Supplier $o,Carbon $date)
|
2020-05-28 05:08:13 +00:00
|
|
|
{
|
|
|
|
$this->aso = $o;
|
|
|
|
$this->date = $date;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Build the message.
|
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public function build()
|
|
|
|
{
|
2024-08-03 01:49:34 +00:00
|
|
|
Config::set('site',$x=Site::where('url',config('app.url'))->sole());
|
2022-09-29 02:16:08 +00:00
|
|
|
|
2020-05-28 05:08:13 +00:00
|
|
|
return $this
|
2024-08-03 01:49:34 +00:00
|
|
|
->markdown('mail.admin.service.traffic_mismatch')
|
2020-05-28 05:08:13 +00:00
|
|
|
->subject('Traffic Mismatch for '.$this->date)
|
|
|
|
->with([
|
2022-09-29 02:16:08 +00:00
|
|
|
'site'=>$x,
|
2020-05-28 05:08:13 +00:00
|
|
|
'date'=>$this->date,
|
|
|
|
'aso'=>$this->aso,
|
|
|
|
]);
|
|
|
|
}
|
2022-09-29 02:16:08 +00:00
|
|
|
}
|