From: NileemaJadhav Date: Fri, 16 Jan 2015 13:38:35 +0000 (+0530) Subject: CRM-15821 Add PCP owner notifications message templates X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f5f9426f80e69e067fcb56fef04fb7cd760e878d;p=civicrm-core.git CRM-15821 Add PCP owner notifications message templates ---------------------------------------- * CRM-15821: Provide option to notify Personal Campaign Page "Owner" when someone donates via their page https://issues.civicrm.org/jira/browse/CRM-15821 --- diff --git a/CRM/Upgrade/4.6.alpha3.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.6.alpha3.msg_template/civicrm_msg_template.tpl new file mode 100644 index 0000000000..2b1367f329 --- /dev/null +++ b/CRM/Upgrade/4.6.alpha3.msg_template/civicrm_msg_template.tpl @@ -0,0 +1,50 @@ +{php} + $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.6.alpha1.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} + +{php} + $ovNames = array( + 'contribution' => array( + 'pcp_owner_notify' => ts('Personal Campaign Pages - Owner Notification', array('escape' => 'sql')), + ), + ); + + $this->assign('ovNames', $ovNames); + $this->assign('dir', $dir); +{/php} + +{foreach from=$ovNames key=name item=ignore} + SELECT @tpl_ogid_{$name} := MAX(id) FROM civicrm_option_group WHERE name = 'msg_tpl_workflow_{$name}'; +{/foreach} + +INSERT INTO civicrm_option_value + (option_group_id, name, {localize field='label'}label{/localize}, value, weight) VALUES +{foreach from=$ovNames key=gName item=ovs name=for_groups} +{foreach from=$ovs key=vName item=label name=for_values} + (@tpl_ogid_{$gName}, '{$vName}', {localize}'{$label}'{/localize}, {$smarty.foreach.for_values.iteration}, {$smarty.foreach.for_values.iteration}) {if $smarty.foreach.for_groups.last and $smarty.foreach.for_values.last};{else},{/if} +{/foreach} +{/foreach} + +{foreach from=$ovNames key=gName item=ovs} +{foreach from=$ovs key=vName item=label} + SELECT @tpl_ovid_{$vName} := MAX(id) FROM civicrm_option_value WHERE option_group_id = @tpl_ogid_{$gName} AND name = '{$vName}'; +{/foreach} +{/foreach} + +INSERT INTO civicrm_msg_template + (msg_title, msg_subject, msg_text, msg_html, workflow_id, is_default, is_reserved) VALUES +{foreach from=$ovNames key=gName item=ovs name=for_groups} +{foreach from=$ovs key=vName item=title name=for_values} + {fetch assign=subject file="`$smarty.const.SMARTY_DIR`/../../CRM/Upgrade/4.6.alpha3.msg_template/message_templates/`$vName`_subject.tpl"} + {fetch assign=text file="`$smarty.const.SMARTY_DIR`/../../CRM/Upgrade/4.6.alpha3.msg_template/message_templates/`$vName`_text.tpl"} + {fetch assign=html file="`$smarty.const.SMARTY_DIR`/../../CRM/Upgrade/4.6.alpha3.msg_template/message_templates/`$vName`_html.tpl"} + ('{$title}', '{$subject|escape:"quotes"}', '{$text|escape:"quotes"}', '{$html|escape:"quotes"}', @tpl_ovid_{$vName}, 1, 0), + ('{$title}', '{$subject|escape:"quotes"}', '{$text|escape:"quotes"}', '{$html|escape:"quotes"}', @tpl_ovid_{$vName}, 0, 1) {if $smarty.foreach.for_groups.last and $smarty.foreach.for_values.last};{else},{/if} +{/foreach} +{/foreach} diff --git a/CRM/Upgrade/4.6.alpha3.msg_template/message_templates/pcp_owner_notify_html.tpl b/CRM/Upgrade/4.6.alpha3.msg_template/message_templates/pcp_owner_notify_html.tpl new file mode 100644 index 0000000000..043c8dfe4c --- /dev/null +++ b/CRM/Upgrade/4.6.alpha3.msg_template/message_templates/pcp_owner_notify_html.tpl @@ -0,0 +1,28 @@ + + + + + + + + +{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} +{capture assign=pcpURL }{crmURL p="civicrm/pcp/info" q="reset=1&id=`$pcpId`" h=0 a=1}{/capture} + +

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

+

{ts}Your fundraising total has been updated.{/ts}
+ {ts}The donor's information is listed below. You can choose to contact them and convey your thanks if you wish.{/ts}
+ {if $is_honor_roll_enabled} + {ts}The donor's name has been added to your honor roll unless they asked not to be included.{/ts}
+ {/if} +

+ + + + + +
{ts}Receive Date{/ts}: {$receive_date|crmDate}
{ts}Amount{/ts}: {$total_amount|crmMoney}
{ts}Name{/ts}: {$donors_display_name}
{ts}Email{/ts}: {$donors_email}
+ + diff --git a/CRM/Upgrade/4.6.alpha3.msg_template/message_templates/pcp_owner_notify_subject.tpl b/CRM/Upgrade/4.6.alpha3.msg_template/message_templates/pcp_owner_notify_subject.tpl new file mode 100644 index 0000000000..83d9e8f933 --- /dev/null +++ b/CRM/Upgrade/4.6.alpha3.msg_template/message_templates/pcp_owner_notify_subject.tpl @@ -0,0 +1 @@ +{ts}Someone has just donated to your personal campaign page{/ts} diff --git a/CRM/Upgrade/4.6.alpha3.msg_template/message_templates/pcp_owner_notify_text.tpl b/CRM/Upgrade/4.6.alpha3.msg_template/message_templates/pcp_owner_notify_text.tpl new file mode 100644 index 0000000000..365eeda55b --- /dev/null +++ b/CRM/Upgrade/4.6.alpha3.msg_template/message_templates/pcp_owner_notify_text.tpl @@ -0,0 +1,19 @@ +=========================================================== +{ts}Personal Campaign Page Owner Notification{/ts} + +=========================================================== +{ts}You have received a donation at your personal page{/ts}: {$page_title} + +{ts}Your fundraising total has been updated.{/ts} +{ts}The donor's information is listed below. You can choose to contact them and convey your thanks if you wish.{/ts} +{if $is_honor_roll_enabled} + {ts}The donor's name has been added to your honor roll unless they asked not to be included.{/ts} +{/if} + +{ts}Receive Date{/ts}: {$receive_date|crmDate} + +{ts}Amount{/ts}: {$total_amount|crmMoney} + +{ts}Name{/ts}: {$donors_display_name} + +{ts}Email{/ts}: {$donors_email} diff --git a/xml/templates/message_templates/pcp_owner_notify_html.tpl b/xml/templates/message_templates/pcp_owner_notify_html.tpl new file mode 100644 index 0000000000..043c8dfe4c --- /dev/null +++ b/xml/templates/message_templates/pcp_owner_notify_html.tpl @@ -0,0 +1,28 @@ + + + + + + + + +{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} +{capture assign=pcpURL }{crmURL p="civicrm/pcp/info" q="reset=1&id=`$pcpId`" h=0 a=1}{/capture} + +

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

+

{ts}Your fundraising total has been updated.{/ts}
+ {ts}The donor's information is listed below. You can choose to contact them and convey your thanks if you wish.{/ts}
+ {if $is_honor_roll_enabled} + {ts}The donor's name has been added to your honor roll unless they asked not to be included.{/ts}
+ {/if} +

+ + + + + +
{ts}Receive Date{/ts}: {$receive_date|crmDate}
{ts}Amount{/ts}: {$total_amount|crmMoney}
{ts}Name{/ts}: {$donors_display_name}
{ts}Email{/ts}: {$donors_email}
+ + diff --git a/xml/templates/message_templates/pcp_owner_notify_subject.tpl b/xml/templates/message_templates/pcp_owner_notify_subject.tpl new file mode 100644 index 0000000000..83d9e8f933 --- /dev/null +++ b/xml/templates/message_templates/pcp_owner_notify_subject.tpl @@ -0,0 +1 @@ +{ts}Someone has just donated to your personal campaign page{/ts} diff --git a/xml/templates/message_templates/pcp_owner_notify_text.tpl b/xml/templates/message_templates/pcp_owner_notify_text.tpl new file mode 100644 index 0000000000..365eeda55b --- /dev/null +++ b/xml/templates/message_templates/pcp_owner_notify_text.tpl @@ -0,0 +1,19 @@ +=========================================================== +{ts}Personal Campaign Page Owner Notification{/ts} + +=========================================================== +{ts}You have received a donation at your personal page{/ts}: {$page_title} + +{ts}Your fundraising total has been updated.{/ts} +{ts}The donor's information is listed below. You can choose to contact them and convey your thanks if you wish.{/ts} +{if $is_honor_roll_enabled} + {ts}The donor's name has been added to your honor roll unless they asked not to be included.{/ts} +{/if} + +{ts}Receive Date{/ts}: {$receive_date|crmDate} + +{ts}Amount{/ts}: {$total_amount|crmMoney} + +{ts}Name{/ts}: {$donors_display_name} + +{ts}Email{/ts}: {$donors_email}