From e74e138cd259ea697f4797b539e77eaa3a6d376d Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 11 Jun 2018 11:01:29 +1200 Subject: [PATCH] Use email_greeting where possible in receipts --- CRM/Upgrade/Incremental/MessageTemplates.php | 4 ++++ .../message_templates/contribution_online_receipt_html.tpl | 2 +- .../message_templates/contribution_online_receipt_text.tpl | 3 ++- xml/templates/message_templates/event_online_receipt_html.tpl | 2 +- xml/templates/message_templates/event_online_receipt_text.tpl | 3 +-- .../message_templates/membership_online_receipt_html.tpl | 2 +- .../message_templates/membership_online_receipt_text.tpl | 2 +- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CRM/Upgrade/Incremental/MessageTemplates.php b/CRM/Upgrade/Incremental/MessageTemplates.php index 158677f7d7..ece6e32606 100644 --- a/CRM/Upgrade/Incremental/MessageTemplates.php +++ b/CRM/Upgrade/Incremental/MessageTemplates.php @@ -75,6 +75,10 @@ class CRM_Upgrade_Incremental_MessageTemplates { 'templates' => [ ['name' => 'membership_online_receipt', 'type' => 'text'], ['name' => 'membership_online_receipt', 'type' => 'html'], + ['name' => 'contribution_online_receipt', 'type' => 'text'], + ['name' => 'contribution_online_receipt', 'type' => 'html'], + ['name' => 'event_online_receipt', 'type' => 'text'], + ['name' => 'event_online_receipt', 'type' => 'html'], ] ], ]; diff --git a/xml/templates/message_templates/contribution_online_receipt_html.tpl b/xml/templates/message_templates/contribution_online_receipt_html.tpl index ec976ed0e5..5f3c65aa17 100644 --- a/xml/templates/message_templates/contribution_online_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_online_receipt_html.tpl @@ -21,7 +21,7 @@ - + {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}

{$greeting},

{/if} {if $receipt_text}

{$receipt_text|htmlize}

{/if} diff --git a/xml/templates/message_templates/contribution_online_receipt_text.tpl b/xml/templates/message_templates/contribution_online_receipt_text.tpl index c6328bc46e..7f016a6d2a 100644 --- a/xml/templates/message_templates/contribution_online_receipt_text.tpl +++ b/xml/templates/message_templates/contribution_online_receipt_text.tpl @@ -1,3 +1,4 @@ +{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if} {if $receipt_text} {$receipt_text} {/if} @@ -206,4 +207,4 @@ {$customName}: {$customValue} {/if} {/foreach} -{/if} \ No newline at end of file +{/if} diff --git a/xml/templates/message_templates/event_online_receipt_html.tpl b/xml/templates/message_templates/event_online_receipt_html.tpl index f7ebf3663e..ec0dab4432 100644 --- a/xml/templates/message_templates/event_online_receipt_html.tpl +++ b/xml/templates/message_templates/event_online_receipt_html.tpl @@ -25,7 +25,7 @@ -

{contact.email_greeting},

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

{$greeting},

{/if} {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}

{$event.confirm_email_text|htmlize}

diff --git a/xml/templates/message_templates/event_online_receipt_text.tpl b/xml/templates/message_templates/event_online_receipt_text.tpl index b0233b41ea..0734384d4c 100644 --- a/xml/templates/message_templates/event_online_receipt_text.tpl +++ b/xml/templates/message_templates/event_online_receipt_text.tpl @@ -1,5 +1,4 @@ -{contact.email_greeting}, - +{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if} {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)} {$event.confirm_email_text} diff --git a/xml/templates/message_templates/membership_online_receipt_html.tpl b/xml/templates/message_templates/membership_online_receipt_html.tpl index 2e6136414f..fbf9fdd460 100644 --- a/xml/templates/message_templates/membership_online_receipt_html.tpl +++ b/xml/templates/message_templates/membership_online_receipt_html.tpl @@ -21,7 +21,7 @@ - + {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}

{$greeting},

{/if} {if $receipt_text}

{$receipt_text|htmlize}

{/if} diff --git a/xml/templates/message_templates/membership_online_receipt_text.tpl b/xml/templates/message_templates/membership_online_receipt_text.tpl index 6072217a09..aa61b62a6c 100644 --- a/xml/templates/message_templates/membership_online_receipt_text.tpl +++ b/xml/templates/message_templates/membership_online_receipt_text.tpl @@ -1,4 +1,4 @@ -{if $contact.email_greeting}{$contact.email_greeting},{/if} +{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if} {if $receipt_text} {$receipt_text} {/if} -- 2.25.1