$participantParams
);
- $sessions = CRM_Event_Cart_BAO_Conference::get_participant_sessions($participantId);
-
// @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) {
'customPost_grouptitle' => $customPostTitles,
'participantID' => $participantId,
'contactID' => $contactID,
- 'conference_sessions' => $sessions,
'credit_card_number' => CRM_Utils_System::mungeCreditCard(CRM_Utils_Array::value('credit_card_number', $participantParams)),
'credit_card_exp_date' => CRM_Utils_Date::mysqlToIso(CRM_Utils_Date::format(CRM_Utils_Array::value('credit_card_exp_date', $participantParams))),
'selfcancelxfer_time' => abs($values['event']['selfcancelxfer_time']),
_eventcart_civix_civicrm_install();
}
+/**
+ * Add the conference session variable to the template.
+ *
+ * @param array $params
+ * @param string $template
+ */
+function eventcart_civicrm_alterMailParams(&$params, $template) {
+ $workflow = $params['workflow'] ?? '';
+ if (($workflow === 'event_online_receipt' || $workflow === 'participant_confirm') && !empty($params['tokenContact']['participant']['id'])) {
+ $params['tplParams']['conference_sessions'] = CRM_Event_Cart_BAO_Conference::get_participant_sessions($params['tokenContact']['participant']['id']);
+ }
+}
+
/**
* Implements hook_civicrm_enable().
*
{if !empty($isPrimary)}
isPrimary:::{$isPrimary}
{/if}
-{if !empty($conference_sessions)}
-conference_sessions:::{$conference_sessions}
-{/if}
{if !empty($is_pay_later)}
is_pay_later:::{$is_pay_later}
{/if}
event.is_monetary:::{$event.is_monetary}
{/if}
event.fee_label:::{event.fee_label}
-{if !empty($conference_sessions)}
-conference_sessions:::{$conference_sessions}
-{/if}
{if !empty($event.participant_role)}
event.participant_role::{$event.participant_role}
defaultRole:::{$defaultRole}
</td>
</tr>
- {if $conference_sessions}
- <tr>
- <td colspan="2" {$labelStyle}>
- {ts}Your schedule:{/ts}
- </td>
- </tr>
- <tr>
- <td colspan="2" {$valueStyle}>
- {assign var='group_by_day' value='NA'}
- {foreach from=$conference_sessions item=session}
- {if $session.start_date|crmDate:"%Y/%m/%d" != $group_by_day|crmDate:"%Y/%m/%d"}
- {assign var='group_by_day' value=$session.start_date}
- <em>{$group_by_day|crmDate:"%m/%d/%Y"}</em><br/>
- {/if}
- {$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}
- <br/>
- {if $session.location} {$session.location}<br/>{/if}
- {/foreach}
- </td>
- </tr>
- {/if}
-
{if !empty($event.participant_role) and $event.participant_role neq 'Attendee' and !empty($defaultRole)}
<tr>
<td {$labelStyle}>
{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|crmDate:"%Y%m%d" == $event.event_start_date|crmDate:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
</td>
</tr>
- {if $conference_sessions}
- <tr>
- <td colspan="2" {$labelStyle}>
- {ts}Your schedule:{/ts}
- </td>
- </tr>
- <tr>
- <td colspan="2" {$valueStyle}>
- {assign var='group_by_day' value='NA'}
- {foreach from=$conference_sessions item=session}
- {if $session.start_date|crmDate:"%Y/%m/%d" != $group_by_day|crmDate:"%Y/%m/%d"}
- {assign var='group_by_day' value=$session.start_date}
- <em>{$group_by_day|crmDate:"%m/%d/%Y"}</em><br />
- {/if}
- {$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}<br />
- {if $session.location} {$session.location}<br />{/if}
- {/foreach}
- </td>
- </tr>
- {/if}
<tr>
<td {$labelStyle}>
{ts}Participant Role{/ts}:
===========================================================
{$event.event_title}
{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|crmDate:"%Y%m%d" == $event.event_start_date|crmDate:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
-{if $conference_sessions}
-
-
-{ts}Your schedule:{/ts}
-{assign var='group_by_day' value='NA'}
-{foreach from=$conference_sessions item=session}
-{if $session.start_date|crmDate:"%Y/%m/%d" != $group_by_day|crmDate:"%Y/%m/%d"}
-{assign var='group_by_day' value=$session.start_date}
-
-{$group_by_day|crmDate:"%m/%d/%Y"}
-
-
-{/if}
-{$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}
-{if $session.location} {$session.location}{/if}
-{/foreach}
-{/if}
-
{ts}Participant Role{/ts}: {$participant.role}