Skip to content

Commit

Permalink
Additional email greetings in message templates
Browse files Browse the repository at this point in the history
  • Loading branch information
seamuslee001 authored and magnolia61 committed Oct 17, 2019
2 parents 82ef31e + 388e68b commit a45b031
Show file tree
Hide file tree
Showing 40 changed files with 141 additions and 40 deletions.
79 changes: 79 additions & 0 deletions CRM/Upgrade/Incremental/MessageTemplates.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,85 @@ protected function getTemplateUpdates() {
['name' => 'pledge_acknowledge', 'type' => 'html'],
],
],
[
'version' => '5.20.alpha1',
'upgrade_descriptor' => ts('Fix missing Email greetings'),
'templates' => [
['name' => 'contribution_dupalert', 'type' => 'subject'],
['name' => 'contribution_invoice_receipt', 'type' => 'subject'],
['name' => 'contribution_offline_receipt', 'type' => 'html'],
['name' => 'contribution_offline_receipt', 'type' => 'subject'],
['name' => 'contribution_offline_receipt', 'type' => 'text'],
['name' => 'contribution_online_receipt', 'type' => 'subject'],
['name' => 'contribution_recurring_billing', 'type' => 'html'],
['name' => 'contribution_recurring_billing', 'type' => 'subject'],
['name' => 'contribution_recurring_billing', 'type' => 'text'],
['name' => 'contribution_recurring_cancelled', 'type' => 'html'],
['name' => 'contribution_recurring_cancelled', 'type' => 'subject'],
['name' => 'contribution_recurring_cancelled', 'type' => 'text'],
['name' => 'contribution_recurring_edit', 'type' => 'html'],
['name' => 'contribution_recurring_edit', 'type' => 'subject'],
['name' => 'contribution_recurring_edit', 'type' => 'text'],
['name' => 'contribution_recurring_notify', 'type' => 'html'],
['name' => 'contribution_recurring_notify', 'type' => 'subject'],
['name' => 'contribution_recurring_notify', 'type' => 'text'],
['name' => 'event_offline_receipt', 'type' => 'html'],
['name' => 'event_offline_receipt', 'type' => 'subject'],
['name' => 'event_offline_receipt', 'type' => 'text'],
['name' => 'event_online_receipt', 'type' => 'html'],
['name' => 'event_online_receipt', 'type' => 'subject'],
['name' => 'event_online_receipt', 'type' => 'text'],
['name' => 'event_registration_receipt', 'type' => 'html'],
['name' => 'event_registration_receipt', 'type' => 'subject'],
['name' => 'event_registration_receipt', 'type' => 'text'],
['name' => 'membership_autorenew_billing', 'type' => 'html'],
['name' => 'membership_autorenew_billing', 'type' => 'subject'],
['name' => 'membership_autorenew_billing', 'type' => 'text'],
['name' => 'membership_autorenew_cancelled', 'type' => 'html'],
['name' => 'membership_autorenew_cancelled', 'type' => 'subject'],
['name' => 'membership_autorenew_cancelled', 'type' => 'text'],
['name' => 'membership_offline_receipt', 'type' => 'html'],
['name' => 'membership_offline_receipt', 'type' => 'subject'],
['name' => 'membership_offline_receipt', 'type' => 'text'],
['name' => 'membership_online_receipt', 'type' => 'subject'],
['name' => 'participant_cancelled', 'type' => 'html'],
['name' => 'participant_cancelled', 'type' => 'subject'],
['name' => 'participant_cancelled', 'type' => 'text'],
['name' => 'participant_confirm', 'type' => 'html'],
['name' => 'participant_confirm', 'type' => 'subject'],
['name' => 'participant_confirm', 'type' => 'text'],
['name' => 'participant_expired', 'type' => 'html'],
['name' => 'participant_expired', 'type' => 'subject'],
['name' => 'participant_expired', 'type' => 'text'],
['name' => 'participant_transferred', 'type' => 'html'],
['name' => 'participant_transferred', 'type' => 'subject'],
['name' => 'participant_transferred', 'type' => 'text'],
['name' => 'payment_or_refund_notification', 'type' => 'html'],
['name' => 'payment_or_refund_notification', 'type' => 'subject'],
['name' => 'payment_or_refund_notification', 'type' => 'text'],
['name' => 'pcp_notify', 'type' => 'subject'],
['name' => 'pcp_owner_notify', 'type' => 'html'],
['name' => 'pcp_owner_notify', 'type' => 'subject'],
['name' => 'pcp_owner_notify', 'type' => 'text'],
['name' => 'pcp_status_change', 'type' => 'subject'],
['name' => 'pcp_supporter_notify', 'type' => 'html'],
['name' => 'pcp_supporter_notify', 'type' => 'subject'],
['name' => 'pcp_supporter_notify', 'type' => 'text'],
['name' => 'petition_confirmation_needed', 'type' => 'html'],
['name' => 'petition_confirmation_needed', 'type' => 'subject'],
['name' => 'petition_confirmation_needed', 'type' => 'text'],
['name' => 'petition_sign', 'type' => 'html'],
['name' => 'petition_sign', 'type' => 'subject'],
['name' => 'petition_sign', 'type' => 'text'],
['name' => 'pledge_acknowledge', 'type' => 'subject'],
['name' => 'pledge_acknowledge', 'type' => 'subject'],
['name' => 'pledge_reminder', 'type' => 'html'],
['name' => 'pledge_reminder', 'type' => 'subject'],
['name' => 'pledge_reminder', 'type' => 'text'],
['name' => 'uf_notify', 'type' => 'subject'],
],
],

];
}

Expand Down
8 changes: 4 additions & 4 deletions tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public function testIPNPaymentMembershipRecurSuccessNoLeakage() {
'Email Address: anthony_anderson@civicrm.org',
'Honor',
'This membership will be automatically renewed every',
'Dear Mr. Anthony Anderson II',
'Dear Anthony',
'Thanks for your auto renew membership sign-up',
'In Memory of',
]);
Expand All @@ -281,7 +281,7 @@ public function testIPNPaymentMembershipRecurSuccessNoLeakage() {
'Last Name: Anderson',
'Email Address: antonia_anderson@civicrm.org',
'This membership will be automatically renewed every',
'Dear Mrs. Antonia Anderson II',
'Dear Antonia',
'Thanks for your auto renew membership sign-up',
]);

Expand Down Expand Up @@ -316,7 +316,7 @@ public function testIPNPaymentMembershipRecurSuccessNoLeakageOnlineThenOffline()
'Last Name: Anderson',
'Email Address: anthony_anderson@civicrm.org',
'This membership will be automatically renewed every',
'Dear Mr. Anthony Anderson II',
'Dear Anthony',
'Thanks for your auto renew membership sign-up',
]);

Expand All @@ -337,7 +337,7 @@ public function testIPNPaymentMembershipRecurSuccessNoLeakageOnlineThenOffline()
'Membership Start Date:',
'Transaction #: hers',
'This membership will be automatically renewed every',
'Dear Mrs. Antonia Anderson II',
'Dear Antonia',
'Thanks for your auto renew membership sign-up',
],
[
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 $formValues.receipt_text}
<p>{$formValues.receipt_text|htmlize}</p>
{else}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}

{if $formValues.receipt_text}
{$formValues.receipt_text}
{else}{ts}Thank you for your support.{/ts}{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<tr>
<td>
<p>{ts 1=$contact.display_name}Dear %1{/ts},</p>
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
<p>{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Billing details for your recurring contribution of %1, every %2 %3 have been updated.{/ts}</p>
</td>
</tr>
Expand Down Expand Up @@ -62,4 +62,4 @@
</center>

</body>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ts 1=$contact.display_name}Dear %1{/ts},
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}

{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Billing details for your recurring contribution of %1, every %2 %3 have been updated.{/ts}

Expand All @@ -20,4 +20,4 @@
{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}


{ts 1=$receipt_from_email}If you have questions please contact us at %1{/ts}
{ts 1=$receipt_from_email}If you have questions please contact us at %1{/ts}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<tr>
<td>
<p>{ts 1=$contact.display_name}Dear %1{/ts},</p>
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
<p>{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Your recurring contribution of %1, every %2 %3 has been cancelled as requested.{/ts}</p>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{ts 1=$contact.display_name}Dear %1{/ts},
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}

{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Your recurring contribution of %1, every %2 %3 has been cancelled as requested.{/ts}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<tr>
<td>
<p>{ts 1=$contact.display_name}Dear %1{/ts},</p>
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
<p>{ts}Your recurring contribution has been updated as requested:{/ts}
<p>{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Recurring contribution is for %1, every %2 %3(s){/ts}{if $installments}{ts 1=$installments} for %1 installments{/ts}{/if}.</p>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{ts 1=$contact.display_name}Dear %1{/ts},
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}

{ts}Your recurring contribution has been updated as requested:{/ts}

{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Recurring contribution is for %1, every %2 %3(s){/ts}
{if $installments}{ts 1=$installments} for %1 installments.{/ts}{/if}

{ts 1=$receipt_from_email}If you have questions please contact us at %1.{/ts}
{ts 1=$receipt_from_email}If you have questions please contact us at %1.{/ts}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ts 1=$displayName}Dear %1{/ts},
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}

{if $recur_txnType eq 'START'}
{if $auto_renew_membership}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{capture assign=labelStyle }style="padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;"{/capture}
{capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}

<p>Dear {contact.display_name},</p>
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
{if $is_pay_later}
<p>
This is being sent to you as an acknowledgement that you have registered one or more members for the following workshop, event or purchase. Please note, however, that the status of your payment is pending, and the registration for this event will not be completed until your payment is received.
Expand All @@ -27,7 +27,6 @@
<p>Your order number is #{$transaction_id}. {if $line_items && !$is_refund} Information about the workshops will be sent separately to each participant.{/if}
Here's a summary of your transaction placed on {$transaction_date|date_format:"%D %I:%M %p %Z"}:</p>


{if $billing_name}
<table class="billing-info">
<tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Dear {contact.display_name},
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}

{if $is_pay_later}
This is being sent to you as an acknowledgement that you have registered one or more members for the following workshop, event or purchase. Please note, however, that the status of your payment is pending, and the registration for this event will not be completed until your payment is received.
{else}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<tr>
<td>
<p>{ts 1=$contact.display_name}Dear %1{/ts},</p>
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
<p>{ts 1=$membershipType}Billing details for your automatically renewed %1 membership have been updated.{/ts}</p>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ts 1=$contact.display_name}Dear %1{/ts},
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}

{ts 1=$membershipType}Billing details for your automatically renewed %1 membership have been updated.{/ts}

Expand All @@ -20,4 +20,4 @@
{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}


{ts 1=$receipt_from_email}If you have questions please contact us at %1{/ts}
{ts 1=$receipt_from_email}If you have questions please contact us at %1{/ts}
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}
<p>{ts 1=$membershipType}The automatic renewal of your %1 membership has been cancelled as requested. This does not affect the status of your membership - you will receive a separate notification when your membership is up for renewal.{/ts}</p>

</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}

{ts 1=$membershipType}The automatic renewal of your %1 membership has been cancelled as requested. This does not affect the status of your membership - you will receive a separate notification when your membership is up for renewal.{/ts}

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

<tr>
<td>
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
{if $formValues.receipt_text_signup}
<p>{$formValues.receipt_text_signup|htmlize}</p>
{elseif $formValues.receipt_text_renewal}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}

{if $formValues.receipt_text_signup}
{$formValues.receipt_text_signup}
{elseif $formValues.receipt_text_renewal}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<tr>
<td>
<p>{ts 1=$contact.display_name}Dear %1{/ts},</p>
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
<p>{ts}Your Event Registration has been cancelled.{/ts}</p>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ts 1=$contact.display_name}Dear %1{/ts},
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}

{ts}Your Event Registration has been cancelled.{/ts}

Expand Down
8 changes: 4 additions & 4 deletions xml/templates/message_templates/participant_confirm_html.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<tr>
<td>
<p>{ts 1=$contact.display_name}Dear %1{/ts},</p>
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
</td>
</tr>
{if !$isAdditional and $participant.id}
Expand All @@ -33,13 +33,13 @@
<tr>
<td colspan="2" {$valueStyle}>
{capture assign=confirmUrl}{crmURL p='civicrm/event/confirm' q="reset=1&participantId=`$participant.id`&cs=`$checksumValue`" a=true h=0 fe=1}{/capture}
<a href="{$confirmUrl}">Go to a web page where you can confirm your registration online</a>
<a href="{$confirmUrl}">{ts}Go to a web page where you can confirm your registration online{/ts}</a>
</td>
</tr>
{/if}
{if $event.allow_selfcancelxfer }
This event allows for self-cancel or transfer
{capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participantID`&{contact.checksum}" h=0 a=1 fe=1}{/capture}
{ts}This event allows for self-cancel or transfer{/ts}
{capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participantID`&{contact.checksum}" h=0 a=1 fe=1}{/capture}
<a href="{$selfService}">{ts}Self service cancel transfer{/ts}</a>
{/if}

Expand Down
3 changes: 2 additions & 1 deletion xml/templates/message_templates/participant_confirm_text.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ts 1=$contact.display_name}Dear %1{/ts},
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}

{if !$isAdditional and $participant.id}

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

<tr>
<td>
<p>{ts 1=$contact.display_name}Dear %1{/ts},</p>
{assign var="greeting" value="{contact.email_greeting}"}{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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ts 1=$contact.display_name}Dear %1{/ts},
{assign var="greeting" value="{contact.email_greeting}"}{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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<tr>
<td>
<p>{ts 1=$contact.display_name}Dear %1{/ts},</p>
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
<p>{ts 1=$to_participant}Your Event Registration has been Transferred to %1.{/ts}</p>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ts 1=$contact.display_name}Dear %1{/ts},
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}

{ts 1=$to_participant}Your Event Registration has been transferred to %1.{/ts}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<!-- END HEADER -->

<!-- BEGIN CONTENT -->
{if $emailGreeting}<tr><td>{$emailGreeting},</td></tr>{/if}
<tr>
<td>
{if $emailGreeting}<tr><td>{$emailGreeting},</td></tr>{/if}
{if $isRefund}
<p>{ts}A refund has been issued based on changes in your registration selections.{/ts}</p>
{else}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{if $emailGreeting}{$emailGreeting},
{/if}{if $isRefund}
{/if}

{if $isRefund}
{ts}A refund has been issued based on changes in your registration selections.{/ts}
{else}
{ts}A payment has been received.{/ts}
Expand Down
1 change: 1 addition & 0 deletions xml/templates/message_templates/pcp_owner_notify_html.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{capture assign=labelStyle }style="padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;"{/capture}
{capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}

{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
<p>{ts}You have received a donation at your personal page{/ts}: <a href="{$pcpInfoURL}">{$page_title}</a></p>
<p>{ts}Your fundraising total has been updated.{/ts}<br/>
{ts}The donor's information is listed below. You can choose to contact them and convey your thanks if you wish.{/ts} <br/>
Expand Down
Loading

0 comments on commit a45b031

Please sign in to comment.