Remove remaining usages of contact & domain values in participant templates
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 3 Nov 2021 03:11:49 +0000 (16:11 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 3 Nov 2021 03:11:49 +0000 (16:11 +1300)
CRM/Event/BAO/Participant.php
CRM/Upgrade/Incremental/MessageTemplates.php
xml/templates/message_templates/participant_confirm_html.tpl
xml/templates/message_templates/participant_confirm_text.tpl
xml/templates/message_templates/participant_expired_html.tpl
xml/templates/message_templates/participant_expired_text.tpl

index 1c29cad05c88ad916d309e2d5f479270f3889111..fe04ccd7acb80232dd470328053483d030a1a7e7 100644 (file)
@@ -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,
index afde107e658d1312e41e57642bc8626fb3a077c9..8de89e46b97d30a8df76608803f0b66ebb3dca22 100644 (file)
@@ -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'],
+        ],
+      ],
     ];
   }
 
index 2d6a112913bb4db5e1720d84992c99eee98ae3fa..bd8b599b166a02a75c57643da60080a98d6ff63d 100644 (file)
@@ -19,7 +19,7 @@
 
   <tr>
    <td>
-    {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
+    {assign var="greeting" value="{contact.email_greeting_display}"}{if $greeting}<p>{$greeting},</p>{/if}
     <p>{ts}This is an invitation to complete your registration that was initially waitlisted.{/ts}</p>
    </td>
   </tr>
       </tr>
      {/if}
 
-     {if $contact.email}
+     {if '{contact.email}'}
       <tr>
        <th {$headerStyle}>
         {ts}Registered Email{/ts}
       </tr>
       <tr>
        <td colspan="2" {$valueStyle}>
-        {$contact.email}
+        {contact.email}
        </td>
       </tr>
      {/if}
   {/if}
   <tr>
    <td colspan="2" {$valueStyle}>
-    <p>{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}</p>
+    <p>{ts 1='{domain.phone}' 2='{domain.email}'}Please contact us at %1 or send email to %2 if you have questions.{/ts}</p>
    </td>
   </tr>
 
index 2c459e66e29fae1203f20663c35453397060d175..0ccf6ad260524621d887dee3c36af9c5acd0e443 100644 (file)
@@ -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}
 
index acd651b878a9ef13577f4393b3d0c78ccdf4f8f2..57804d1429d0c411178e33c543723de3cc1b0090 100644 (file)
 
   <tr>
    <td>
-    {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
+    {assign var="greeting" value="{contact.email_greeting_display}"}{if $greeting}<p>{$greeting},</p>{/if}
     <p>{ts 1=$event.event_title}Your pending event registration for %1 has expired
 because you did not confirm your registration.{/ts}</p>
-    <p>{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions
+    <p>{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}</p>
    </td>
   </tr>
@@ -90,7 +90,7 @@ or want to inquire about reinstating your registration for this event.{/ts}</p>
       {/foreach}
      {/if}
 
-     {if $contact.email}
+     {if '{contact.email}'}
       <tr>
        <th {$headerStyle}>
         {ts}Registered Email{/ts}
@@ -98,7 +98,7 @@ or want to inquire about reinstating your registration for this event.{/ts}</p>
       </tr>
       <tr>
        <td colspan="2" {$valueStyle}>
-        {$contact.email}
+        {contact.email}
        </td>
       </tr>
      {/if}
@@ -120,7 +120,7 @@ or want to inquire about reinstating your registration for this event.{/ts}</p>
 
   <tr>
    <td>
-    <p>{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}</p>
+    <p>{ts 1='{domain.phone}' 2='{domain.email}'}Please contact us at %1 or send email to %2 if you have questions.{/ts}</p>
    </td>
   </tr>
 
index 0ff598ca7735e7a22149ab3ff590652e3528df56..e6ec27f026105d71b9777d197f7fc6f10d430f97 100644 (file)
@@ -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}