Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use email_greeting where possible in receipts #12296

Merged
merged 1 commit into from
Jul 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CRM/Upgrade/Incremental/MessageTemplates.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ protected function getTemplateUpdates() {
'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'],
]
],
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<tr>
<td>

{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
{if $receipt_text}
<p>{$receipt_text|htmlize}</p>
{/if}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}
{if $receipt_text}
{$receipt_text}
{/if}
Expand Down Expand Up @@ -206,4 +207,4 @@
{$customName}: {$customValue}
{/if}
{/foreach}
{/if}
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<tr>
<td>
<p>{contact.email_greeting},</p>
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}

{if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}
<p>{$event.confirm_email_text|htmlize}</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -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}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<tr>
<td>

{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
{if $receipt_text}
<p>{$receipt_text|htmlize}</p>
{/if}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{if $contact.email_greeting}{$contact.email_greeting},{/if}
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused about what's going on here. Why assign a variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to avoid a comma if there is none

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old code appears to already be doing that. Am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colemanw I only just added the old code on this template (as part of getting the message update functionality merged - I used it as an example). When I tested as part of this it didn't work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colemanw note change from {if $contact.email_greeting} to {contact.email_greeting} - it's not a smarty token

{if $receipt_text}
{$receipt_text}
{/if}
Expand Down