diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 09f06ac9cc7a..ec9d0e6b485d 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -1143,6 +1143,15 @@ public static function sendMail($contactID, $values, $participantId, $isTest = F // @todo - the goal is that all params available to the message template are explicitly defined here rather than // 'in a smattering of places'. Note that leakage can happen between mailings when not explicitly defined. + if ($postProfileID) { + $customPostTitles = empty($profilePost[1]) ? NULL : []; + foreach ($postProfileID as $offset => $id) { + $customPostTitles[$offset] = CRM_Core_BAO_UFGroup::getFrontEndTitle((int) $id); + } + } + else { + $customPostTitles = NULL; + } $tplParams = array_merge($values, $participantParams, [ 'email' => $email, 'confirm_email_text' => CRM_Utils_Array::value('confirm_email_text', $values['event']), @@ -1152,7 +1161,7 @@ public static function sendMail($contactID, $values, $participantId, $isTest = F 'customPre' => $profilePre[0], 'customPre_grouptitle' => empty($profilePre[1]) ? NULL : [CRM_Core_BAO_UFGroup::getFrontEndTitle((int) $preProfileID)], 'customPost' => $profilePost[0], - 'customPost_grouptitle' => empty($profilePost[1]) ? NULL : [CRM_Core_BAO_UFGroup::getFrontEndTitle((int) $postProfileID)], + 'customPost_grouptitle' => $customPostTitles, 'participantID' => $participantId, 'conference_sessions' => $sessions, 'credit_card_number' => CRM_Utils_System::mungeCreditCard(CRM_Utils_Array::value('credit_card_number', $participantParams)),