failed job envoi notification in Queue Laravel 5.5
Bonsoir,
j'utilise Laravel 5.5 sur un projet et j'envoi une notification a chaque utilisateur inscris pour activer son email.
Code:
1 2 3 4 5 6 7 8 9 10 11
|
...
use App\Jobs\SendConfirmationEmailJob;
class SendConfirmationEmail
{
public function handle(UserRegistered $event)
{
// SEND CONFIRMATION JOB
SendConfirmationEmailJob::dispatch($event->user);
}
} |
SendConfirmationEmailJob class
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
...
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Notifications\ActivatedAccountCandidate;
class SendConfirmationEmailJob
{
public $user;
public function __construct(User $user)
{
$this->user = $user;
}
public function handle()
{
$this->user->notify(new ActivatedAccountCandidate);
}
} |
quand j’exécute mon système envoi notification without Queue, je reçois bien l'email, mais quand j’implémente le ShouldQueue à la classe:
My job failed,
j'en sais pas pourquoi :(
Code:
$this->user->notify(...)