Skip to content

Commit

Permalink
Merge branch 'hotfix' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jimyhuang committed Jun 6, 2024
2 parents 3fd02a7 + cb8284f commit 002b67c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
14 changes: 7 additions & 7 deletions CRM/Contribute/Form/AdditionalInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,17 @@ static function postProcessCommon(&$params, &$formatted) {
*/
static function emailReceipt(&$form, &$params, $ccContribution = FALSE) {
$config = CRM_Core_Config::singleton();
require_once 'CRM/Contact/BAO/Contact/Location.php';
list($contributorDisplayName,
$contributorEmail
) = CRM_Contact_BAO_Contact_Location::getEmailDetails($params['contact_id']);
if (!empty($params['is_attach_receipt'])) {
$receiptEmailType = !empty($config->receiptEmailType) ? $config->receiptEmailType : 'copy_only';
$receiptTask = new CRM_Contribute_Form_Task_PDF();
$receiptTask->makeReceipt($params['contribution_id'], $receiptEmailType, TRUE);
//set encrypt password
if (!empty($config->receiptEmailEncryption) && $config->receiptEmailEncryption) {
$receiptPwd = $form->userEmail;
$receiptPwd = $contributorEmail;
if (!empty($receiptTask->_lastSerialId) && preg_match('/^[A-Za-z]{1,2}\d{8,9}$|^\d{8}$/', $receiptTask->_lastSerialId)) {
$receiptPwd = $receiptTask->_lastSerialId;
}
Expand Down Expand Up @@ -456,8 +460,8 @@ static function emailReceipt(&$form, &$params, $ccContribution = FALSE) {
else {
//offline contribution
//Retrieve the name and email from receipt is to be send
$params['receipt_from_name'] = $form->userDisplayName;
$params['receipt_from_email'] = $form->userEmail;
$params['receipt_from_name'] = $contributorDisplayName;
$params['receipt_from_email'] = $contributorEmail;
// assigned various dates to the templates
$form->assign('receipt_date', CRM_Utils_Date::processDate($params['receipt_date']));
$form->assign('cancel_date', CRM_Utils_Date::processDate($params['cancel_date']));
Expand Down Expand Up @@ -517,11 +521,7 @@ static function emailReceipt(&$form, &$params, $ccContribution = FALSE) {
$params['receipt_text'] = CRM_Contribute_BAO_ContributionPage::tokenize($params['contact_id'], $params['receipt_text']);
}
$form->assign_by_ref('formValues', $params);
require_once 'CRM/Contact/BAO/Contact/Location.php';
require_once 'CRM/Utils/Mail.php';
list($contributorDisplayName,
$contributorEmail
) = CRM_Contact_BAO_Contact_Location::getEmailDetails($params['contact_id']);
$form->assign('contactID', $params['contact_id']);
$form->assign('contributionID', $params['contribution_id']);
$form->assign('currency', $params['currency']);
Expand Down
9 changes: 0 additions & 9 deletions CRM/Contribute/Form/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -1705,15 +1705,6 @@ public function postProcess() {
);
}

if ($this->_contactID) {
require_once 'CRM/Contact/BAO/Contact/Location.php';
list($this->userDisplayName,
$this->userEmail
) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
$this->assign('displayName', $this->userDisplayName);
$this->assign('contactID', $this->_contactID);
}

//send receipt mail.
if ($contribution->id && CRM_Utils_Array::value('is_email_receipt', $formValues)) {
$formValues['contact_id'] = $this->_contactID;
Expand Down

0 comments on commit 002b67c

Please sign in to comment.