Fix calls to Email::sanitizeEmail
This commit is contained in:
parent
8d0a454713
commit
cf8def4328
1 changed files with 5 additions and 6 deletions
|
@ -8,9 +8,12 @@ namespace Modules\MMFRestrictedCustomers\Console\Commands;
|
||||||
|
|
||||||
use App\Attachment;
|
use App\Attachment;
|
||||||
use App\Conversation;
|
use App\Conversation;
|
||||||
|
use App\Email;
|
||||||
|
use App\Thread;
|
||||||
|
|
||||||
use App\Events\CustomerCreatedConversation;
|
use App\Events\CustomerCreatedConversation;
|
||||||
use App\Events\CustomerReplied;
|
use App\Events\CustomerReplied;
|
||||||
use App\Thread;
|
|
||||||
use App\Console\Commands\FetchEmails as BaseFetchEmails;
|
use App\Console\Commands\FetchEmails as BaseFetchEmails;
|
||||||
|
|
||||||
use Modules\MMFRestrictedCustomers\Entities\Customer;
|
use Modules\MMFRestrictedCustomers\Entities\Customer;
|
||||||
|
@ -676,7 +679,7 @@ class FetchEmails extends BaseFetchEmails {
|
||||||
}
|
}
|
||||||
foreach ($recipient_emails as $recipient_email) {
|
foreach ($recipient_emails as $recipient_email) {
|
||||||
// No need to check mailbox aliases.
|
// No need to check mailbox aliases.
|
||||||
if (\App\Email::sanitizeEmail($check_mailbox->email) == $recipient_email) {
|
if (Email::sanitizeEmail($check_mailbox->email) == $recipient_email) {
|
||||||
$this->extra_import[] = [
|
$this->extra_import[] = [
|
||||||
'mailbox' => $check_mailbox,
|
'mailbox' => $check_mailbox,
|
||||||
'message' => $message,
|
'message' => $message,
|
||||||
|
@ -753,10 +756,6 @@ class FetchEmails extends BaseFetchEmails {
|
||||||
public function createCustomers($emails, $mailbox) {
|
public function createCustomers($emails, $mailbox) {
|
||||||
$exclude_emails = $mailbox->getEmails();
|
$exclude_emails = $mailbox->getEmails();
|
||||||
foreach ($emails as $item) {
|
foreach ($emails as $item) {
|
||||||
// Email belongs to mailbox
|
|
||||||
// if (in_array(Email::sanitizeEmail($item->mail), $exclude_emails)) {
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
$data = [
|
$data = [
|
||||||
'mailbox_id' => $mailbox->id,
|
'mailbox_id' => $mailbox->id,
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue