From 6f09413b885deb8af92561a1565063931cb093b0 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 3 Nov 2021 16:11:49 +1300 Subject: [PATCH] Remove remaining usages of contact & domain values in participant templates --- CRM/Event/BAO/Participant.php | 6 ++---- CRM/Upgrade/Incremental/MessageTemplates.php | 19 +++++++++++++++++++ .../participant_confirm_html.tpl | 8 ++++---- .../participant_confirm_text.tpl | 8 ++++---- .../participant_expired_html.tpl | 10 +++++----- .../participant_expired_text.tpl | 10 +++++----- 6 files changed, 39 insertions(+), 22 deletions(-) diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index 1c29cad05c..fe04ccd7ac 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -1455,15 +1455,13 @@ UPDATE civicrm_participant 'contactId' => $contactId, 'tokenContext' => ['participantId' => $participantId], 'tplParams' => [ - 'contact' => $contactDetails, - 'domain' => $domainValues, 'participant' => $participantValues, 'event' => $eventDetails, 'paidEvent' => $eventDetails['is_monetary'] ?? NULL, 'isShowLocation' => $eventDetails['is_show_location'] ?? NULL, 'isAdditional' => $participantValues['registered_by_id'], - 'isExpired' => $mailType == 'Expired', - 'isConfirm' => $mailType == 'Confirm', + 'isExpired' => $mailType === 'Expired', + 'isConfirm' => $mailType === 'Confirm', 'checksumValue' => $checksumValue, ], 'from' => $receiptFrom, diff --git a/CRM/Upgrade/Incremental/MessageTemplates.php b/CRM/Upgrade/Incremental/MessageTemplates.php index afde107e65..8de89e46b9 100644 --- a/CRM/Upgrade/Incremental/MessageTemplates.php +++ b/CRM/Upgrade/Incremental/MessageTemplates.php @@ -295,6 +295,25 @@ class CRM_Upgrade_Incremental_MessageTemplates { ['name' => 'participant_cancelled', 'type' => 'html'], ], ], + + [ + 'version' => '5.44.alpha1', + 'upgrade_descriptor' => ts('Use domain and contact tokens instead of smarty values'), + 'label' => ts('Participant Expired'), + 'templates' => [ + ['name' => 'participant_expired', 'type' => 'text'], + ['name' => 'participant_expired', 'type' => 'html'], + ], + ], + [ + 'version' => '5.44.alpha1', + 'upgrade_descriptor' => ts('Use domain and contact tokens instead of smarty values'), + 'label' => ts('Participant Confirmed'), + 'templates' => [ + ['name' => 'participant_confirm', 'type' => 'text'], + ['name' => 'participant_confirm', 'type' => 'html'], + ], + ], ]; } diff --git a/xml/templates/message_templates/participant_confirm_html.tpl b/xml/templates/message_templates/participant_confirm_html.tpl index 2d6a112913..bd8b599b16 100644 --- a/xml/templates/message_templates/participant_confirm_html.tpl +++ b/xml/templates/message_templates/participant_confirm_html.tpl @@ -19,7 +19,7 @@ - {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}

{$greeting},

{/if} + {assign var="greeting" value="{contact.email_greeting_display}"}{if $greeting}

{$greeting},

{/if}

{ts}This is an invitation to complete your registration that was initially waitlisted.{/ts}

@@ -134,7 +134,7 @@ {/if} - {if $contact.email} + {if '{contact.email}'} {ts}Registered Email{/ts} @@ -142,7 +142,7 @@ - {$contact.email} + {contact.email} {/if} @@ -172,7 +172,7 @@ {/if} -

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}

+

{ts 1='{domain.phone}' 2='{domain.email}'}Please contact us at %1 or send email to %2 if you have questions.{/ts}

diff --git a/xml/templates/message_templates/participant_confirm_text.tpl b/xml/templates/message_templates/participant_confirm_text.tpl index 2c459e66e2..0ccf6ad260 100644 --- a/xml/templates/message_templates/participant_confirm_text.tpl +++ b/xml/templates/message_templates/participant_confirm_text.tpl @@ -1,4 +1,4 @@ -{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if} +{assign var="greeting" value="{contact.email_greeting_display}"}{if $greeting}{$greeting},{/if} {ts}This is an invitation to complete your registration that was initially waitlisted.{/ts} @@ -67,18 +67,18 @@ Click this link to go to a web page where you can confirm your registration onli {ts}Download iCalendar File:{/ts} {$icalFeed} {/if} -{if $contact.email} +{if '{contact.email}'} =========================================================== {ts}Registered Email{/ts} =========================================================== -{$contact.email} +{contact.email} {/if} {if $register_date} {ts}Registration Date{/ts}: {$participant.register_date|crmDate} {/if} -{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts} +{ts 1='{domain.phone}' 2='{domain.email}'}Please contact us at %1 or send email to %2 if you have questions.{/ts} diff --git a/xml/templates/message_templates/participant_expired_html.tpl b/xml/templates/message_templates/participant_expired_html.tpl index acd651b878..57804d1429 100644 --- a/xml/templates/message_templates/participant_expired_html.tpl +++ b/xml/templates/message_templates/participant_expired_html.tpl @@ -20,10 +20,10 @@ - {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}

{$greeting},

{/if} + {assign var="greeting" value="{contact.email_greeting_display}"}{if $greeting}

{$greeting},

{/if}

{ts 1=$event.event_title}Your pending event registration for %1 has expired because you did not confirm your registration.{/ts}

-

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions +

{ts 1='{domain.phone}' 2='{domain.email}'}Please contact us at %1 or send email to %2 if you have questions or want to inquire about reinstating your registration for this event.{/ts}

@@ -90,7 +90,7 @@ or want to inquire about reinstating your registration for this event.{/ts}

{/foreach} {/if} - {if $contact.email} + {if '{contact.email}'} {ts}Registered Email{/ts} @@ -98,7 +98,7 @@ or want to inquire about reinstating your registration for this event.{/ts}

- {$contact.email} + {contact.email} {/if} @@ -120,7 +120,7 @@ or want to inquire about reinstating your registration for this event.{/ts}

-

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}

+

{ts 1='{domain.phone}' 2='{domain.email}'}Please contact us at %1 or send email to %2 if you have questions.{/ts}

diff --git a/xml/templates/message_templates/participant_expired_text.tpl b/xml/templates/message_templates/participant_expired_text.tpl index 0ff598ca77..e6ec27f026 100644 --- a/xml/templates/message_templates/participant_expired_text.tpl +++ b/xml/templates/message_templates/participant_expired_text.tpl @@ -1,10 +1,10 @@ -{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if} +{assign var="greeting" value="{contact.email_greeting_display}"}{if $greeting}{$greeting},{/if} {ts 1=$event.event_title}Your pending event registration for %1 has expired because you did not confirm your registration.{/ts} -{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions +{ts 1='{domain.phone}' 2='{domain.email}'}Please contact us at %1 or send email to %2 if you have questions or want to inquire about reinstating your registration for this event.{/ts} =========================================================== @@ -34,18 +34,18 @@ or want to inquire about reinstating your registration for this event.{/ts} {ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach} {/if} -{if $contact.email} +{if '{contact.email}'} =========================================================== {ts}Registered Email{/ts} =========================================================== -{$contact.email} +{contact.email} {/if} {if $register_date} {ts}Registration Date{/ts}: {$participant.register_date|crmDate} {/if} -{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts} +{ts 1='{domain.phone}' 2='{domain.email}'}Please contact us at %1 or send email to %2 if you have questions.{/ts} -- 2.25.1