diff --git a/app/Livewire/Customer/Plugins/Show.php b/app/Livewire/Customer/Plugins/Show.php index 587b3b7b..f9de3970 100644 --- a/app/Livewire/Customer/Plugins/Show.php +++ b/app/Livewire/Customer/Plugins/Show.php @@ -221,7 +221,7 @@ public function submitForReview(): void // Notify $user->notify(new PluginSubmitted($this->plugin)); - Notification::route('mail', config('mail.support_address')) + Notification::route('mail', [config('mail.support_address'), config('mail.marketplace_address')]) ->notify(new PluginPendingReview($this->plugin)); Flux::toast(variant: 'success', text: 'Your plugin has been submitted for review!'); diff --git a/app/Models/Plugin.php b/app/Models/Plugin.php index 585758be..598cb033 100644 --- a/app/Models/Plugin.php +++ b/app/Models/Plugin.php @@ -1116,7 +1116,7 @@ public function messageAdmins(string $message, ?int $causerId = null): PluginAct 'causer_id' => $causerId ?? $this->user_id, ]); - Notification::route('mail', config('mail.support_address')) + Notification::route('mail', [config('mail.support_address'), config('mail.marketplace_address')]) ->notify(new PluginDeveloperReplied($this, $activity)); return $activity; diff --git a/config/mail.php b/config/mail.php index d8984256..6cf3cdc7 100644 --- a/config/mail.php +++ b/config/mail.php @@ -116,6 +116,19 @@ 'support_address' => env('MAIL_SUPPORT_ADDRESS', 'support@nativephp.com'), + /* + |-------------------------------------------------------------------------- + | Marketplace Address + |-------------------------------------------------------------------------- + | + | The mailbox for the Marketplace team. Plugin review submissions and + | developer replies to review messages are sent here as well as to the + | support address. + | + */ + + 'marketplace_address' => env('MAIL_MARKETPLACE_ADDRESS', 'marketplace@nativephp.com'), + /* |-------------------------------------------------------------------------- | Markdown Mail Settings diff --git a/tests/Feature/CustomerPluginReviewChecksTest.php b/tests/Feature/CustomerPluginReviewChecksTest.php index 4801bf15..2a17a3e1 100644 --- a/tests/Feature/CustomerPluginReviewChecksTest.php +++ b/tests/Feature/CustomerPluginReviewChecksTest.php @@ -141,7 +141,7 @@ public function submitting_a_plugin_for_review_runs_review_checks(): void Notification::assertSentOnDemand( PluginPendingReview::class, function (PluginPendingReview $notification, array $channels, object $notifiable) use ($plugin) { - return $notifiable->routes['mail'] === 'support@nativephp.com' + return $notifiable->routes['mail'] === ['support@nativephp.com', 'marketplace@nativephp.com'] && $notification->plugin->id === $plugin->id; } ); diff --git a/tests/Feature/Livewire/Customer/PluginMessagesTest.php b/tests/Feature/Livewire/Customer/PluginMessagesTest.php index 66be084a..69ac9f98 100644 --- a/tests/Feature/Livewire/Customer/PluginMessagesTest.php +++ b/tests/Feature/Livewire/Customer/PluginMessagesTest.php @@ -242,7 +242,7 @@ public function test_developer_can_reply_and_the_team_is_notified(): void Notification::assertSentOnDemand( PluginDeveloperReplied::class, - fn (PluginDeveloperReplied $notification, array $channels, object $notifiable) => $notifiable->routes['mail'] === 'support@nativephp.com' + fn (PluginDeveloperReplied $notification, array $channels, object $notifiable) => $notifiable->routes['mail'] === ['support@nativephp.com', 'marketplace@nativephp.com'] && $notification->plugin->is($plugin) && $notification->activity->is($reply) );