Skip to content

Commit

Permalink
CATL-1614: Update inbound email processing - get email params even if…
Browse files Browse the repository at this point in the history
… no matching contact found
  • Loading branch information
i-grou committed Aug 19, 2020
1 parent 86a0638 commit 7f523b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CRM/Utils/Mail/EmailProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public static function _process($civiMail, $dao, $is_create_activities) {
// if its the activities that needs to be processed ..
try {
$createContact = !($dao->is_contact_creation_disabled_if_no_match ?? FALSE);
$mailParams = CRM_Utils_Mail_Incoming::parseMailingObject($mail, $createContact);
$mailParams = CRM_Utils_Mail_Incoming::parseMailingObject($mail, $createContact, FALSE);
}
catch (Exception $e) {
echo $e->getMessage();
Expand Down
5 changes: 3 additions & 2 deletions CRM/Utils/Mail/Incoming.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,11 @@ public function &parse(&$file) {
/**
* @param $mail
* @param $createContact
* @param $requireContact
*
* @return array
*/
public static function parseMailingObject(&$mail, $createContact = TRUE) {
public static function parseMailingObject(&$mail, $createContact = TRUE, $requireContact = TRUE) {

$config = CRM_Core_Config::singleton();

Expand All @@ -347,7 +348,7 @@ public static function parseMailingObject(&$mail, $createContact = TRUE) {

// we definitely need a contact id for the from address
// if we dont have one, skip this email
if (empty($params['from']['id'])) {
if ($requireContact && empty($params['from']['id'])) {
return NULL;
}

Expand Down

0 comments on commit 7f523b3

Please sign in to comment.