Skip to content

Commit

Permalink
Additional_Email_Greetings_in_workflow_message_templates
Browse files Browse the repository at this point in the history
  • Loading branch information
magnolia61 committed Oct 13, 2019
1 parent 3a2aba3 commit c00176a
Show file tree
Hide file tree
Showing 40 changed files with 109 additions and 46 deletions.
45 changes: 45 additions & 0 deletions CRM/Upgrade/Incremental/MessageTemplates.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,51 @@ protected function getTemplateUpdates() {
['name' => 'pledge_acknowledge', 'type' => 'html'],
],
],
[
'version' => '5.20.alpha1',
'upgrade_descriptor' => ts('Aditional email greetings and translation fixes'),
'templates' => [
['name' => 'contribution_recurring_billing', 'type' => 'html'],
['name' => 'contribution_recurring_billing', 'type' => 'text'],
['name' => 'contribution_recurring_cancelled', 'type' => 'html'],
['name' => 'contribution_recurring_cancelled', 'type' => 'text'],
['name' => 'contribution_recurring_edit', 'type' => 'html'],
['name' => 'contribution_recurring_edit', 'type' => 'text'],
['name' => 'contribution_recurring_notify', 'type' => 'html'],
['name' => 'contribution_recurring_notify', 'type' => 'text'],
['name' => 'event_registration_receipt', 'type' => 'html'],
['name' => 'event_registration_receipt', 'type' => 'text'],
['name' => 'membership_autorenew_billing', 'type' => 'html'],
['name' => 'membership_autorenew_billing', 'type' => 'text'],
['name' => 'participant_cancelled', 'type' => 'html'],
['name' => 'participant_cancelled', 'type' => 'text'],
['name' => 'participant_confirm', 'type' => 'html'],
['name' => 'participant_confirm', 'type' => 'text'],
['name' => 'participant_expired', 'type' => 'html'],
['name' => 'participant_expired', 'type' => 'text'],
['name' => 'participant_transferred', 'type' => 'html'],
['name' => 'participant_transferred', 'type' => 'text'],
['name' => 'pcp_supporter_notify', 'type' => 'html'],
['name' => 'pcp_supporter_notify', 'type' => 'text'],
['name' => 'pledge_reminder', 'type' => 'html'],
['name' => 'pledge_reminder', 'type' => 'text'],
['name' => 'contribution_offline_receipt', 'type' => 'html'],
['name' => 'contribution_offline_receipt', 'type' => 'text'],
['name' => 'membership_autorenew_cancelled', 'type' => 'html'],
['name' => 'membership_autorenew_cancelled', 'type' => 'text'],
['name' => 'membership_offline_receipt', 'type' => 'html'],
['name' => 'membership_offline_receipt', 'type' => 'text'],
['name' => 'payment_or_refund_notification', 'type' => 'html'],
['name' => 'payment_or_refund_notification', 'type' => 'text'],
['name' => 'pcp_owner_notify', 'type' => 'html'],
['name' => 'pcp_owner_notify', 'type' => 'text'],
['name' => 'petition_confirmation_needed.tpl', 'type' => 'html'],
['name' => 'petition_confirmation_needed.tpl', 'type' => 'text'],
['name' => 'petition_sign.tpl', 'type' => 'html'],
['name' => 'petition_sign.tpl', 'type' => 'text'],
],
],

];
}

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,11 +21,9 @@

<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}
<p>{ts}Thank you for your support.{/ts}</p>
{/if}

<p>{ts}Please print this receipt for your records.{/ts}</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{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}
{/if}

{ts}Please print this receipt for your records.{/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=$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 Expand Up @@ -94,7 +94,7 @@
<tr>
<td>
<p>{ts}Your recurring contribution term has ended.{/ts}</p>
<p>{ts 1=$recur_installments}You have successfully completed %1 recurring contributions. Thank you for your support.{/ts}</p>
<p>{ts 1=$recur_installments}You have successfully completed %1 recurring contributions.{/ts}</p>
</td>
</tr>
<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 Expand Up @@ -49,7 +49,7 @@
{ts}Your recurring contribution term has ended.{/ts}


{ts 1=$recur_installments}You have successfully completed %1 recurring contributions. Thank you for your support.{/ts}
{ts 1=$recur_installments}You have successfully completed %1 recurring contributions.{/ts}


==================================================
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 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,12 +21,11 @@

<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}
<p>{$formValues.receipt_text_renewal|htmlize}</p>
{else}
<p>{ts}Thank you for your support.{/ts}</p>
{/if}
{if ! $cancelled}
<p>{ts}Please print this receipt for your records.{/ts}</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{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}
{$formValues.receipt_text_renewal}
{else}{ts}Thank you for your support.{/ts}{/if}
{/if}

{if ! $cancelled}{ts}Please print this receipt for your records.{/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}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
6 changes: 3 additions & 3 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}
{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>
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/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,4 +1,5 @@
{if $emailGreeting}{$emailGreeting},
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}

{/if}{if $isRefund}
{ts}A refund has been issued based on changes in your registration selections.{/ts}
{else}
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
2 changes: 2 additions & 0 deletions xml/templates/message_templates/pcp_owner_notify_text.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{ts}Personal Campaign Page Owner Notification{/ts}

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

{ts}You have received a donation at your personal page{/ts}: {$page_title}
>> {$pcpInfoURL}

Expand Down
Loading

0 comments on commit c00176a

Please sign in to comment.