From: Jon Goldberg Date: Mon, 5 Feb 2024 22:49:58 +0000 (-0500) Subject: don't send an extra receipt when completing pending contributions X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=06ef9e0f3d2899be9fbab587965181fec199a78a;p=civicrm-core.git don't send an extra receipt when completing pending contributions --- diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index c63fbc46bb..2815e79330 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -2034,6 +2034,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP && 'Completed' === CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $this->getSubmittedValue('contribution_status_id'))) { // @todo make users use add payment form. civicrm_api3('Payment', 'create', [ + 'is_send_contribution_notification' => FALSE, 'contribution_id' => $this->getContributionID(), 'total_amount' => $this->getContributionValue('balance_amount'), 'currency' => $this->getSubmittedValue('currency'), @@ -2048,6 +2049,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $this->invoicingPostProcessHook($submittedValues, $action, $lineItem); //send receipt mail. + //FIXME: 'payment.create' could send a receipt. if ($contribution->id && !empty($formValues['is_email_receipt'])) { $formValues['contact_id'] = $this->_contactID; $formValues['contribution_id'] = $contribution->id;