Skip to content

Commit

Permalink
Merge pull request #21459 from eileenmcnaughton/mem
Browse files Browse the repository at this point in the history
[Ref] Remove no-longer-used variables
  • Loading branch information
eileenmcnaughton authored Sep 14, 2021
2 parents ef47bbe + d513432 commit 3a50b67
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions CRM/Member/Form/Task/PDFLetter.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,8 @@ public function postProcessMembers($membershipIDs, $skipOnHold, $skipDeceased, $
$html
= $this->generateHTML(
$membershipIDs,
$returnProperties,
$skipOnHold,
$skipDeceased,
$messageToken,
$html_message,
$categories
$html_message
);
CRM_Contact_Form_Task_PDFLetterCommon::createActivities($form, $html_message, $contactIDs, $formValues['subject'], CRM_Utils_Array::value('campaign_id', $formValues));
CRM_Utils_PDF_Utils::html2pdf($html, $this->getFileName() . '.pdf', FALSE, $formValues);
Expand All @@ -112,19 +108,17 @@ public function postProcessMembers($membershipIDs, $skipOnHold, $skipDeceased, $
/**
* Generate html for pdf letters.
*
* @internal
*
* @param array $membershipIDs
* @param array $returnProperties
* @param bool $skipOnHold
* @param bool $skipDeceased
* @param array $messageToken
* @param $html_message
* @param $categories
*
* @return array
* @throws \API_Exception
* @throws \CRM_Core_Exception
* @internal
*
*/
public function generateHTML($membershipIDs, $returnProperties, $skipOnHold, $skipDeceased, $messageToken, $html_message, $categories) {
public function generateHTML($membershipIDs, $messageToken, $html_message): array {
$memberships = CRM_Utils_Token::getMembershipTokenDetails($membershipIDs);
$html = [];

Expand All @@ -133,7 +127,11 @@ public function generateHTML($membershipIDs, $returnProperties, $skipOnHold, $sk
// get contact information
$contactId = $membership['contact_id'];
$tokenHtml = CRM_Utils_Token::replaceEntityTokens('membership', $membership, $html_message, $messageToken);
$html[] = CRM_Core_BAO_MessageTemplate::renderTemplate(['messageTemplate' => ['msg_html' => $tokenHtml], 'contactId' => $contactId])['html'];
$html[] = CRM_Core_BAO_MessageTemplate::renderTemplate([
'messageTemplate' => ['msg_html' => $tokenHtml],
'contactId' => $contactId,
'disableSmarty' => !defined('CIVICRM_MAIL_SMARTY') || !CIVICRM_MAIL_SMARTY,
])['html'];

}
return $html;
Expand Down

0 comments on commit 3a50b67

Please sign in to comment.