From e3bab073d874c5c9066a485d5959124ec575ec86 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 16 Sep 2023 15:26:39 +1200 Subject: [PATCH] Fix online event receipt to use the same location tokens as offline --- .../event_online_receipt_html.tpl | 71 +++++++++++++------ .../event_online_receipt_text.tpl | 10 +-- 2 files changed, 53 insertions(+), 28 deletions(-) diff --git a/xml/templates/message_templates/event_online_receipt_html.tpl b/xml/templates/message_templates/event_online_receipt_html.tpl index 3bda72c979..6f5c41d2ed 100644 --- a/xml/templates/message_templates/event_online_receipt_html.tpl +++ b/xml/templates/message_templates/event_online_receipt_html.tpl @@ -107,36 +107,61 @@ {/if} - {if !empty($location.phone.1.phone) || !empty($location.email.1.email)} + {if {event.loc_block_id.phone_id.phone|boolean} || {event.loc_block_id.email_id.email|boolean}} {ts}Event Contacts:{/ts} - {foreach from=$location.phone item=phone} - {if $phone.phone} - - - {if $phone.phone_type} - {$phone.phone_type_display} + + {if {event.loc_block_id.phone_id.phone|boolean}} + + + {if {event.loc_block_id.phone_id.phone_type_id|boolean}} + {event.loc_block_id.phone_id.phone_type_id:label} {else} - {ts}Phone{/ts} + {ts}Phone{/ts} {/if} - - - {$phone.phone} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if} - - - {/if} - {/foreach} - {foreach from=$location.email item=eventEmail} - {if $eventEmail.email} - - {ts}Email{/ts} - {$eventEmail.email} - - {/if} - {/foreach} + + + {event.loc_block_id.phone_id.phone} {if {event.loc_block_id.phone_id.phone_ext|boolean}} {ts}ext.{/ts} {event.loc_block_id.phone_id.phone_ext}{/if} + + + {/if} + {if {event.loc_block_id.phone_2_id.phone|boolean}} + + + {if {event.loc_block_id.phone_2_id.phone_type_id|boolean}} + {event.loc_block_id.phone_2_id.phone_type_id:label} + {else} + {ts}Phone{/ts} + {/if} + + + {event.loc_block_id.phone_2_id.phone} {if {event.loc_block_id.phone_2_id.phone_ext|boolean}} {ts}ext.{/ts} {event.loc_block_id.phone_2_id.phone_ext}{/if} + + + {/if} + {if {event.loc_block_id.email_id.email|boolean}} + + + {ts}Email{/ts} + + + {event.loc_block_id.email_id.email} + + + {/if} + {if {event.loc_block_id.email_2_id.email|boolean}} + + + {ts}Email{/ts} + + + {event.loc_block_id.email_2_id.email} + + + {/if} {/if} {if {event.is_public|boolean}} diff --git a/xml/templates/message_templates/event_online_receipt_text.tpl b/xml/templates/message_templates/event_online_receipt_text.tpl index 77642e2e1f..6f2f794fbc 100644 --- a/xml/templates/message_templates/event_online_receipt_text.tpl +++ b/xml/templates/message_templates/event_online_receipt_text.tpl @@ -80,12 +80,12 @@ {if {event.loc_block_id.phone_id.phone|boolean}} {if {event.loc_block_id.phone_id.phone_type_id|boolean}}{event.loc_block_id.phone_id.phone_type_id:label}{else}{ts}Phone{/ts}{/if} {event.loc_block_id.phone_id.phone} {if {event.loc_block_id.phone_id.phone_ext|boolean}} {ts}ext.{/ts} {event.loc_block_id.phone_id.phone_ext}{/if} {/if} -{foreach from=$location.email item=eventEmail} -{if $eventEmail.email} - -{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach} +{if {event.loc_block_id.email_id.email|boolean}} +{ts}Email {/ts}{event.loc_block_id.email_id.email} +{/if} +{if {event.loc_block_id.email_2_id.email|boolean}} +{ts}Email {/ts}{event.loc_block_id.email_2_id.email}{/if} {/if} - {if {event.is_public|boolean}} {capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture} {ts}Download iCalendar entry for this event.{/ts} {$icalFeed} -- 2.25.1