From f4e14af600c0d8a4349668ebc93ae468162799ee Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Thu, 15 Feb 2024 14:42:51 +0100 Subject: [PATCH] Make notifications queueable The VerifyEmail notification is hooked up into the registration workflow. If this notification fails, the registration fails. Now the notification is queued and won't make the registration fail. Instead, the notification may be retried on the queue. --- src/Notifications/Unsubscribed.php | 6 +++++- src/Notifications/VerifyEmail.php | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Notifications/Unsubscribed.php b/src/Notifications/Unsubscribed.php index b68c336..d9a5ab0 100644 --- a/src/Notifications/Unsubscribed.php +++ b/src/Notifications/Unsubscribed.php @@ -2,11 +2,15 @@ namespace Biigle\Modules\Newsletter\Notifications; +use Illuminate\Bus\Queueable; +use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; -class Unsubscribed extends Notification +class Unsubscribed extends Notification implements ShouldQueue { + use Queueable; + /** * Get the notification's delivery channels. * diff --git a/src/Notifications/VerifyEmail.php b/src/Notifications/VerifyEmail.php index 5cb766a..6856032 100644 --- a/src/Notifications/VerifyEmail.php +++ b/src/Notifications/VerifyEmail.php @@ -4,11 +4,15 @@ use Carbon\Carbon; use Illuminate\Auth\Notifications\VerifyEmail as Base; +use Illuminate\Bus\Queueable; +use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; use URL; -class VerifyEmail extends Base +class VerifyEmail extends Base implements ShouldQueue { + use Queueable; + /** * Get the verify email notification mail message for the given URL. *