Skip to content

Commit

Permalink
Wrap membership receipt in an outer function.
Browse files Browse the repository at this point in the history
This function is neither static nor shared & we work to replace the
other / put the parts that really are shared somewhere sensible
  • Loading branch information
eileenmcnaughton committed Aug 20, 2018
1 parent c3729e0 commit 2073036
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion CRM/Member/Form/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,10 @@ private function convertIsOverrideValue() {
/**
* Send email receipt.
*
* @deprecated
* This function is shared with Batch_Entry which has limited overlap
* & needs rationalising.
*
* @param CRM_Core_Form $form
* Form object.
* @param array $formValues
Expand Down Expand Up @@ -1698,7 +1702,7 @@ public function submit() {
$formValues['receipt_text_signup'] = $formValues['receipt_text'];
// send email receipt
$this->assignBillingName();
$mailSend = self::emailReceipt($this, $formValues, $membership);
$mailSend = $this->emailMembershipReceipt();
$receiptSent = TRUE;
}

Expand Down Expand Up @@ -1945,4 +1949,16 @@ protected function isUpdateToExistingRecurringMembership() {
return $isRecur;
}

/**
* Send a receipt for the membership.
*
* @param array $formValues
* @param array $membership
* @return array
*/
protected function emailMembershipReceipt($formValues, $membership) {
$mailSend = self::emailReceipt($this, $formValues, $membership);
return [$membership, $mailSend];
}

}

0 comments on commit 2073036

Please sign in to comment.