2019-09-25 16:08:50 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Jobs;
|
|
|
|
|
|
|
|
use App\Mail\ReminderMail;
|
|
|
|
use App\Mail\WelcomeMail;
|
2020-03-20 16:37:36 +01:00
|
|
|
use App\User;
|
2019-09-25 16:08:50 +02:00
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
use Illuminate\Support\Facades\Mail;
|
|
|
|
|
|
|
|
class SendReminderEmail implements ShouldQueue
|
|
|
|
{
|
|
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
|
2020-03-20 16:37:36 +01:00
|
|
|
/** @var User */
|
2019-09-25 16:08:50 +02:00
|
|
|
private $user;
|
2020-03-20 16:37:36 +01:00
|
|
|
|
2019-09-25 16:08:50 +02:00
|
|
|
/**
|
|
|
|
* Create a new job instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct($user)
|
|
|
|
{
|
|
|
|
$this->user = $user;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Execute the job.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function handle()
|
|
|
|
{
|
|
|
|
Mail::to($this->user->getEmailForVerification())
|
|
|
|
->queue(new ReminderMail($this->user));
|
|
|
|
}
|
|
|
|
}
|