Skip to content

Commit

Permalink
Merge pull request #18029 from eileenmcnaughton/sendmail
Browse files Browse the repository at this point in the history
[Ref] Simplify is_email_receipt in sendMail
  • Loading branch information
mattwire authored Aug 2, 2020
2 parents 926dba9 + 081ee44 commit 6c22094
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
19 changes: 1 addition & 18 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -2927,7 +2927,7 @@ public function composeMessageArray(&$input, &$ids, &$values, $returnMessageText

//not really sure what params might be passed in but lets merge em into values
$values = array_merge($this->_gatherMessageValues($input, $values, $ids), $values);
$values['is_email_receipt'] = $this->isEmailReceipt($input, $values);
$values['is_email_receipt'] = !$returnMessageText;
if (!empty($input['receipt_date'])) {
$values['receipt_date'] = $input['receipt_date'];
}
Expand Down Expand Up @@ -5707,23 +5707,6 @@ protected function loadRelatedEntitiesByID($ids) {
}
}

/**
* Should an email receipt be sent for this contribution when complete.
*
* @param array $input
*
* @return mixed
*/
protected function isEmailReceipt($input) {
if (isset($input['is_email_receipt'])) {
return $input['is_email_receipt'];
}
if (!empty($this->_relatedObjects['contribution_page_id'])) {
return $this->_relatedObjects['contribution_page_id']->is_email_receipt;
}
return TRUE;
}

/**
* Function to replace contribution tokens.
*
Expand Down
1 change: 0 additions & 1 deletion api/v3/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ function civicrm_api3_contribution_sendconfirmation($params) {
'payment_processor_id',
];
$input = array_intersect_key($params, array_flip($allowedParams));
$input['is_email_receipt'] = TRUE;
CRM_Contribute_BAO_Contribution::sendMail($input, $ids, $params['id']);
}

Expand Down

0 comments on commit 6c22094

Please sign in to comment.