Skip to content

Commit

Permalink
Merge pull request #9382 from monishdeb/CRM-16558
Browse files Browse the repository at this point in the history
CRM-16558: Remove Update Subscription URL link from recurring contribution emails when not available
  • Loading branch information
monishdeb authored Nov 14, 2016
2 parents 614fc6a + 042e777 commit fb8011b
Show file tree
Hide file tree
Showing 9 changed files with 1,038 additions and 15 deletions.
16 changes: 16 additions & 0 deletions CRM/Upgrade/4.7.14.msg_template/civicrm_msg_template.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{php}
$dir = SMARTY_DIR . '/../../CRM/Upgrade/4.7.14.msg_template/message_templates';
$templates = array();
foreach (preg_grep('/\.tpl$/', scandir($dir)) as $filename) {
$parts = explode('_', basename($filename, '.tpl'));
$templates[] = array('type' => array_pop($parts), 'name' => implode('_', $parts), 'filename' => "$dir/$filename");
}
$this->assign('templates', $templates);
{/php}

{foreach from=$templates item=tpl}
{fetch assign=content file=$tpl.filename}
SELECT @workflow_id := MAX(id) FROM civicrm_option_value WHERE name = '{$tpl.name}';
SELECT @content := msg_{$tpl.type} FROM civicrm_msg_template WHERE workflow_id = @workflow_id AND is_reserved = 1 LIMIT 1;
UPDATE civicrm_msg_template SET msg_{$tpl.type} = '{$content|escape:"quotes"}' WHERE workflow_id = @workflow_id AND (is_reserved = 1 OR (is_default = 1 AND msg_{$tpl.type} = @content));
{/foreach}
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
</head>
<body>

{capture assign=headerStyle}colspan="2" style="text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;"{/capture}
{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}

<center>
<table width="620" border="0" cellpadding="0" cellspacing="0" id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left;">

<!-- BEGIN HEADER -->
<!-- You can add table row(s) here with logo or other header elements -->
<!-- END HEADER -->

<!-- BEGIN CONTENT -->

<tr>
<td>
<p>{ts 1=$displayName}Dear %1{/ts},</p>
</td>
</tr>

<tr>
<td>&nbsp;</td>
</tr>

{if $recur_txnType eq 'START'}
{if $auto_renew_membership}
<tr>
<td>
<p>{ts}Thanks for your auto renew membership sign-up.{/ts}</p>
<p>{ts 1=$recur_frequency_interval 2=$recur_frequency_unit}This membership will be automatically renewed every %1 %2(s). {/ts}</p>
</td>
</tr>
<tr>
<td {$labelStyle}>
{ts 1=$cancelSubscriptionUrl}This membership will be renewed automatically. You can cancel the auto-renewal option by <a href="%1">visiting this web page</a>.{/ts}
</td>
</tr>
{if $updateSubscriptionBillingUrl}
<tr>
<td {$labelStyle}>
{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by <a href="%1">visiting this web page</a>.{/ts}
</td>
</tr>
{/if}
{else}
<tr>
<td>
<p>{ts}Thanks for your recurring contribution sign-up.{/ts}</p>
<p>{ts 1=$recur_frequency_interval 2=$recur_frequency_unit}This recurring contribution will be automatically processed every %1 %2(s){/ts}{if $recur_installments }{ts 1=$recur_installments} for a total of %1 installment(s){/ts}{/if}.</p>
<p>{ts}Start Date{/ts}: {$recur_start_date|crmDate}</p>
</td>
</tr>
<tr>
<td {$labelStyle}>
{ts 1=$cancelSubscriptionUrl} You can cancel the recurring contribution option by <a href="%1">visiting this web page</a>.{/ts}
</td>
</tr>
{if $updateSubscriptionBillingUrl}
<tr>
<td {$labelStyle}>
{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}
</td>
</tr>
{/if}
<tr>
<td {$labelStyle}>
{ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments details for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}
</td>
</tr>
{/if}

{elseif $recur_txnType eq 'END'}

{if $auto_renew_membership}
<tr>
<td>
<p>{ts}Your auto renew membership sign-up has ended and your membership will not be automatically renewed.{/ts}</p>
</td>
</tr>
{else}
<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>
</td>
</tr>
<tr>
<td>
<table style="border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse; width:100%;">
<tr>
<th {$headerStyle}>
{ts 1=$recur_installments}Interval of Subscription for %1 installment(s){/ts}
</th>
</tr>
<tr>
<td {$labelStyle}>
{ts}Start Date{/ts}
</td>
<td {$valueStyle}>
{$recur_start_date|crmDate}
</td>
</tr>
<tr>
<td {$labelStyle}>
{ts}End Date{/ts}
</td>
<td {$valueStyle}>
{$recur_end_date|crmDate}
</td>
</tr>
</table>
</td>
</tr>

{/if}
{/if}

</table>
</center>

</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{ts 1=$displayName}Dear %1{/ts},

{if $recur_txnType eq 'START'}
{if $auto_renew_membership}
{ts}Thanks for your auto renew membership sign-up.{/ts}


{ts 1=$recur_frequency_interval 2=$recur_frequency_unit}This membership will be automatically renewed every %1 %2(s).{/ts}

{ts 1=$cancelSubscriptionUrl}This membership will be renewed automatically. You can cancel the auto-renewal option by <a href="%1">visiting this web page</a>.{/ts}

{if $updateSubscriptionBillingUrl}
{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by <a href="%1">visiting this web page</a>.{/ts}

{/if}
{else}
{ts}Thanks for your recurring contribution sign-up.{/ts}


{ts 1=$recur_frequency_interval 2=$recur_frequency_unit 3=$recur_installments}This recurring contribution will be automatically processed every %1 %2(s){/ts}{if $recur_installments } {ts 1=$recur_installments} for a total of %1 installment(s){/ts}{/if}.

{ts}Start Date{/ts}: {$recur_start_date|crmDate}

{ts 1=$cancelSubscriptionUrl}You can cancel the recurring contribution option by <a href="%1">visiting this web page</a>.{/ts}

{if $updateSubscriptionBillingUrl}
{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}

{/if}
{ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}
{/if}

{elseif $recur_txnType eq 'END'}
{if $auto_renew_membership}
{ts}Your auto renew membership sign-up has ended and your membership will not be automatically renewed.{/ts}


{else}
{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}Interval of Subscription for %1 installment(s){/ts}

==================================================
{ts}Start Date{/ts}: {$recur_start_date|crmDate}

{ts}End Date{/ts}: {$recur_end_date|crmDate}

{/if}
{/if}
Loading

0 comments on commit fb8011b

Please sign in to comment.