Skip to content

Commit

Permalink
CATL-1613: Do not create contacts if email is skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
i-grou committed Sep 10, 2020
1 parent 7c0ff7e commit 248c73d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions CRM/Utils/Mail/EmailProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,15 @@ public static function _process($civiMail, $dao, $is_create_activities) {

// preseve backward compatibility
if ($usedfor == 0 || $is_create_activities) {
// Mail account may have 'Skip emails which do not have a Case ID
// or Case token' option, if its enabled and email is not related
// to cases - then we need to put email to ignored folder.
$caseMailUtils = new CRM_Utils_Mail_CaseMail();
if (!empty($dao->is_non_case_email_skipped) && !$caseMailUtils->isCaseEmail($mail->subject)) {
$store->markIgnored($key);
continue;
}

// if its the activities that needs to be processed ..
try {
$createContact = !($dao->is_contact_creation_disabled_if_no_match ?? FALSE);
Expand All @@ -235,15 +244,6 @@ public static function _process($civiMail, $dao, $is_create_activities) {
continue;
}

// Mail account may have 'Skip emails which do not have a Case ID
// or Case token' option, if its enabled and email is not related
// to cases - then we need to put email to ignored folder.
$caseMailUtils = new CRM_Utils_Mail_CaseMail();
if (!empty($dao->is_non_case_email_skipped) && !$caseMailUtils->isCaseEmail($mail->subject)) {
$store->markIgnored($key);
continue;
}

$paramsBuilder = new CRM_Utils_Mail_ParamsBuilder();
$params = $paramsBuilder->buildActivityParams($mailParams, $emailActivityTypeId);

Expand Down

0 comments on commit 248c73d

Please sign in to comment.