57 lines
1.4 KiB
PHP
57 lines
1.4 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Jobs;
|
||
|
|
|
||
|
|
use App\Models\Sant;
|
||
|
|
use Illuminate\Bus\Queueable;
|
||
|
|
use App\Mail\UserConfirmEmail;
|
||
|
|
use App\Mail\WrongChaturmasEmail;
|
||
|
|
use Illuminate\Support\Facades\Log;
|
||
|
|
use Illuminate\Support\Facades\Mail;
|
||
|
|
use Illuminate\Queue\SerializesModels;
|
||
|
|
use Illuminate\Queue\InteractsWithQueue;
|
||
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||
|
|
|
||
|
|
class SendWrongChaturmas implements ShouldQueue
|
||
|
|
{
|
||
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @var
|
||
|
|
*/
|
||
|
|
protected $user;
|
||
|
|
protected $santID;
|
||
|
|
protected $chaturmasID;
|
||
|
|
protected $description;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* SendWrongChaturmas constructor.
|
||
|
|
* @param $user
|
||
|
|
*/
|
||
|
|
public function __construct($user, $santID, $chaturmasID, $description)
|
||
|
|
{
|
||
|
|
$this->user = $user;
|
||
|
|
$this->santID = $santID;
|
||
|
|
$this->chaturmasID = $chaturmasID;
|
||
|
|
$this->description = $description;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Execute the job.
|
||
|
|
*
|
||
|
|
* @return void
|
||
|
|
*/
|
||
|
|
public function handle()
|
||
|
|
{
|
||
|
|
try {
|
||
|
|
// $sant = Sant::where('id', $this->santID)->first();
|
||
|
|
$email = new WrongChaturmasEmail($this->user, $this->santID, $this->chaturmasID, $this->description);
|
||
|
|
Mail::to('connect@globaljain.net')->queue($email);
|
||
|
|
|
||
|
|
} catch (\Exception $ex) {
|
||
|
|
Log::error($ex);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|