diff --git a/config/support-bubble.php b/config/support-bubble.php index 25a558e..3b54ae2 100644 --- a/config/support-bubble.php +++ b/config/support-bubble.php @@ -18,6 +18,12 @@ */ 'mail_to' => null, + /** + * This queue will be used when sending out mails. + * When set to null, the default queue will be used. + */ + 'queue_name' => null, + /* * When set to true use currently logged in user to fill in * the name and email fields. Both fields will also be hidden. diff --git a/src/SupportBubbleServiceProvider.php b/src/SupportBubbleServiceProvider.php index 7a3e488..c1ccbe4 100644 --- a/src/SupportBubbleServiceProvider.php +++ b/src/SupportBubbleServiceProvider.php @@ -45,7 +45,10 @@ protected function registerMailNotificationEventHandler(): void { Event::listen(function (SupportBubbleSubmittedEvent $event) { Notification::route('mail', config('support-bubble.mail_to')) - ->notify(BubbleResponseNotification::fromEvent($event)); + ->notify( + BubbleResponseNotification::fromEvent($event) + ->onQueue(config('support-bubble.queue_name')) + ); }); } }