From 7e9edd5d2140ed9226f5602fc5955b032195e7d5 Mon Sep 17 00:00:00 2001 From: FreeScout Date: Tue, 2 Jul 2019 10:55:11 -0700 Subject: [PATCH] Exclude mailbox emails from recipients on reply --- app/Http/Controllers/ConversationsController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Http/Controllers/ConversationsController.php b/app/Http/Controllers/ConversationsController.php index 51984ae0..7d4020fb 100644 --- a/app/Http/Controllers/ConversationsController.php +++ b/app/Http/Controllers/ConversationsController.php @@ -142,6 +142,14 @@ class ConversationsController extends Controller } } + // Exclude mailbox emails from $to_customers. + $mailbox_emails = $mailbox->getEmails(); + foreach ($to_customers as $key => $to_customer) { + if (in_array($to_customer['email'], $mailbox_emails)) { + unset($to_customers[$key]); + } + } + // Previous conversations $prev_conversations = []; if ($customer) {