Merge pull request #2758 from pratik-joshi/CRM-14278
[civicrm-core.git] / xml / templates / civicrm_msg_template.tpl
1 -- +--------------------------------------------------------------------+
2 -- | CiviCRM version 4.5 |
3 -- +--------------------------------------------------------------------+
4 -- | Copyright CiviCRM LLC (c) 2004-2014 |
5 -- +--------------------------------------------------------------------+
6 -- | This file is a part of CiviCRM. |
7 -- | |
8 -- | CiviCRM is free software; you can copy, modify, and distribute it |
9 -- | under the terms of the GNU Affero General Public License |
10 -- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
11 -- | |
12 -- | CiviCRM is distributed in the hope that it will be useful, but |
13 -- | WITHOUT ANY WARRANTY; without even the implied warranty of |
14 -- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
15 -- | See the GNU Affero General Public License for more details. |
16 -- | |
17 -- | You should have received a copy of the GNU Affero General Public |
18 -- | License and the CiviCRM Licensing Exception along |
19 -- | with this program; if not, contact CiviCRM LLC |
20 -- | at info[AT]civicrm[DOT]org. If you have questions about the |
21 -- | GNU Affero General Public License or the licensing of CiviCRM, |
22 -- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
23 -- +--------------------------------------------------------------------+
24 --
25 -- Generated from {$smarty.template}
26 -- {$generated}
27 --
28 {* not sure how to define the below in Smarty, so doing it in PHP instead *}
29 {php}
30 $ogNames = array(
31 'case' => ts('Message Template Workflow for Cases', array('escape' => 'sql')),
32 'contribution' => ts('Message Template Workflow for Contributions', array('escape' => 'sql')),
33 'event' => ts('Message Template Workflow for Events', array('escape' => 'sql')),
34 'friend' => ts('Message Template Workflow for Tell-a-Friend', array('escape' => 'sql')),
35 'membership' => ts('Message Template Workflow for Memberships', array('escape' => 'sql')),
36 'meta' => ts('Message Template Workflow for Meta Templates', array('escape' => 'sql')),
37 'pledge' => ts('Message Template Workflow for Pledges', array('escape' => 'sql')),
38 'uf' => ts('Message Template Workflow for Profiles', array('escape' => 'sql')),
39 'petition' => ts('Message Template Workflow for Petition', array('escape' => 'sql')),
40 );
41 $ovNames = array(
42 'case' => array(
43 'case_activity' => ts('Cases - Send Copy of an Activity', array('escape' => 'sql')),
44 ),
45 'contribution' => array(
46 'contribution_dupalert' => ts('Contributions - Duplicate Organization Alert', array('escape' => 'sql')),
47 'contribution_offline_receipt' => ts('Contributions - Receipt (off-line)', array('escape' => 'sql')),
48 'contribution_online_receipt' => ts('Contributions - Receipt (on-line)', array('escape' => 'sql')),
49 'contribution_recurring_notify' => ts('Contributions - Recurring Start and End Notification', array('escape' => 'sql')),
50 'contribution_recurring_cancelled' => ts('Contributions - Recurring Cancellation Notification', array('escape' => 'sql')),
51 'contribution_recurring_billing' => ts('Contributions - Recurring Billing Updates', array('escape' => 'sql')),
52 'contribution_recurring_edit' => ts('Contributions - Recurring Updates', array('escape' => 'sql')),
53 'pcp_notify' => ts('Personal Campaign Pages - Admin Notification', array('escape' => 'sql')),
54 'pcp_status_change' => ts('Personal Campaign Pages - Supporter Status Change Notification', array('escape' => 'sql')),
55 'pcp_supporter_notify' => ts('Personal Campaign Pages - Supporter Welcome', array('escape' => 'sql')),
56 'payment_or_refund_notification' => ts('Additional Payment Receipt or Refund Notification', array('escape' => 'sql')),
57 ),
58 'event' => array(
59 'event_offline_receipt' => ts('Events - Registration Confirmation and Receipt (off-line)', array('escape' => 'sql')),
60 'event_online_receipt' => ts('Events - Registration Confirmation and Receipt (on-line)', array('escape' => 'sql')),
61 'event_registration_receipt' => ts('Events - Receipt only', array('escape' => 'sql')),
62 'participant_cancelled' => ts('Events - Registration Cancellation Notice', array('escape' => 'sql')),
63 'participant_confirm' => ts('Events - Registration Confirmation Invite', array('escape' => 'sql')),
64 'participant_expired' => ts('Events - Pending Registration Expiration Notice', array('escape' => 'sql')),
65 ),
66 'friend' => array(
67 'friend' => ts('Tell-a-Friend Email', array('escape' => 'sql')),
68 ),
69 'membership' => array(
70 'membership_offline_receipt' => ts('Memberships - Signup and Renewal Receipts (off-line)', array('escape' => 'sql')),
71 'membership_online_receipt' => ts('Memberships - Receipt (on-line)', array('escape' => 'sql')),
72 'membership_autorenew_cancelled' => ts('Memberships - Auto-renew Cancellation Notification', array('escape' => 'sql')),
73 'membership_autorenew_billing' => ts('Memberships - Auto-renew Billing Updates', array('escape' => 'sql')),
74 ),
75 'meta' => array(
76 'test_preview' => ts('Test-drive - Receipt Header', array('escape' => 'sql')),
77 ),
78 'pledge' => array(
79 'pledge_acknowledge' => ts('Pledges - Acknowledgement', array('escape' => 'sql')),
80 'pledge_reminder' => ts('Pledges - Payment Reminder', array('escape' => 'sql')),
81 ),
82 'uf' => array(
83 'uf_notify' => ts('Profiles - Admin Notification', array('escape' => 'sql')),
84 ),
85 'petition' => array(
86 'petition_sign' => ts('Petition - signature added', array('escape' => 'sql')),
87 'petition_confirmation_needed' => ts('Petition - need verification', array('escape' => 'sql')),
88 ),
89 );
90 $this->assign('ogNames', $ogNames);
91 $this->assign('ovNames', $ovNames);
92 {/php}
93
94 INSERT INTO civicrm_option_group
95 (name, {localize field='title'}title{/localize}, {localize field='description'}description{/localize}, is_reserved, is_active) VALUES
96 {foreach from=$ogNames key=name item=description name=for_groups}
97 ('msg_tpl_workflow_{$name}', {localize}'{$description}'{/localize}, {localize}'{$description}'{/localize}, 1, 1) {if $smarty.foreach.for_groups.last};{else},{/if}
98 {/foreach}
99
100 {foreach from=$ogNames key=name item=description}
101 SELECT @tpl_ogid_{$name} := MAX(id) FROM civicrm_option_group WHERE name = 'msg_tpl_workflow_{$name}';
102 {/foreach}
103
104 INSERT INTO civicrm_option_value
105 (option_group_id, name, {localize field='label'}label{/localize}, value, weight) VALUES
106 {foreach from=$ovNames key=gName item=ovs name=for_groups}
107 {foreach from=$ovs key=vName item=label name=for_values}
108 (@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}
109 {/foreach}
110 {/foreach}
111
112 {foreach from=$ovNames key=gName item=ovs}
113 {foreach from=$ovs key=vName item=label}
114 SELECT @tpl_ovid_{$vName} := MAX(id) FROM civicrm_option_value WHERE option_group_id = @tpl_ogid_{$gName} AND name = '{$vName}';
115 {/foreach}
116 {/foreach}
117
118 INSERT INTO civicrm_msg_template
119 (msg_title, msg_subject, msg_text, msg_html, workflow_id, is_default, is_reserved) VALUES
120 {foreach from=$ovNames key=gName item=ovs name=for_groups}
121 {foreach from=$ovs key=vName item=title name=for_values}
122 {fetch assign=subject file="`$smarty.const.SMARTY_DIR`/../../xml/templates/message_templates/`$vName`_subject.tpl"}
123 {fetch assign=text file="`$smarty.const.SMARTY_DIR`/../../xml/templates/message_templates/`$vName`_text.tpl"}
124 {fetch assign=html file="`$smarty.const.SMARTY_DIR`/../../xml/templates/message_templates/`$vName`_html.tpl"}
125 ('{$title}', '{$subject|escape:"quotes"}', '{$text|escape:"quotes"}', '{$html|escape:"quotes"}', @tpl_ovid_{$vName}, 1, 0),
126 ('{$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}
127 {/foreach}
128 {/foreach}
129
130 {* Sample CiviMail Newsletter message template *}
131 INSERT INTO civicrm_msg_template
132 (msg_title, msg_subject, msg_text, msg_html, workflow_id, is_default, is_reserved)
133 VALUES
134 ('Sample CiviMail Newsletter Template', 'Sample CiviMail Newsletter', '', '<table width=612 cellpadding=0 cellspacing=0 bgcolor="#ffffff">
135 <tr>
136 <td colspan="2" bgcolor="#ffffff" valign="middle" >
137 <table border="0" cellpadding="0" cellspacing="0" >
138 <tr>
139 <td>
140 <a href="http://www.civicrm.org"><img src="http://civicrm.org/sites/civicrm.org/files/top-logo_2.png" border=0 alt="Replace this logo with the URL to your own"></a>
141 </td>
142 <td>&nbsp; &nbsp;</td>
143 <td>
144 <a href="http://www.civicrm.org" style="text-decoration: none;"><font size=5 face="Arial, Verdana, sans-serif" color="#8bc539">Your Newsletter Title</font></a>
145 </td>
146 </tr>
147 </table>
148 </td>
149 </tr>
150 <tr>
151 <td valign="top" width="70%">
152 <!-- left column -->
153 <table cellpadding="10" cellspacing="0" border="0">
154 <tr>
155 <td style="font-family: Arial, Verdana, sans-serif; font-size: 12px;" >
156 <font face="Arial, Verdana, sans-serif" size="2" >
157 Greetings {literal}{contact.display_name}{/literal},
158 <br /><br />
159 This is a sample template designed to help you get started creating and sending your own CiviMail messages. This template uses an HTML layout that is generally compatible with the wide variety of email clients that your recipients might be using (e.g. Gmail, Outlook, Yahoo, etc.).
160 <br /><br />You can select this "Sample CiviMail Newsletter Template" from the "Use Template" drop-down in Step 3 of creating a mailing, and customize it to your needs. Then check the "Save as New Template" box on the bottom the page to save your customized version for use in future mailings.
161 <br /><br />The logo you use must be uploaded to your server. Copy and paste the URL path to the logo into the &lt;img src= tag in the HTML at the top. Click "Source" or the Image button if you are using the text editor.
162 <br /><br />
163 Edit the color of the links and headers using the color button or by editing the HTML.
164 <br /><br />
165 Your newsletter message and donation appeal can go here. Click the link button to <a href="#">create links</a> - remember to use a fully qualified URL starting with http:// in all your links!
166 <br /><br />
167 To use CiviMail:
168 <ul>
169 <li><a href="http://book.civicrm.org/user/advanced-configuration/email-system-configuration/">Configure your Email System</a>.</li>
170 <li>Make sure your web hosting provider allows outgoing bulk mail, and see if they have a restriction on quantity. If they don\'t allow bulk mail, consider <a href="https://civicrm.org/providers/hosting">finding a new host</a>.</li>
171 </ul>
172 Sincerely,
173 <br /><br />
174 Your Team
175 <br /><br />
176 </font>
177 </td>
178 </tr>
179 </table>
180 </td>
181
182 <td valign="top" width="30%" bgcolor="#ffffff" style="border: 1px solid #056085;">
183 <!-- right column -->
184 <table cellpadding=10 cellspacing=0 border=0>
185 <tr>
186 <td bgcolor="#056085"><font face="Arial, Verdana, sans-serif" size="4" color="#ffffff">News and Events</font></td>
187 </tr>
188 <tr>
189 <td style="color: #000; font-family: Arial, Verdana, sans-serif; font-size: 12px;" >
190 <font face="Arial, Verdana, sans-serif" size="2" >
191 <font color="#056085"><strong>Featured Events</strong> </font><br />
192 Fundraising Dinner<br />
193 Training Meeting<br />
194 Board of Directors Annual Meeting<br />
195
196 <br /><br />
197 <font color="#056085"><strong>Community Events</strong></font><br />
198 Bake Sale<br />
199 Charity Auction<br />
200 Art Exhibit<br />
201
202 <br /><br />
203 <font color="#056085"><strong>Important Dates</strong></font><br />
204 Tuesday August 27<br />
205 Wednesday September 8<br />
206 Thursday September 29<br />
207 Saturday October 1<br />
208 Sunday October 20<br />
209 </font>
210 </td>
211 </tr>
212 </table>
213 </td>
214 </tr>
215
216 <tr>
217 <td colspan="2">
218 <table cellpadding="10" cellspacing="0" border="0">
219 <tr>
220 <td>
221 <font face="Arial, Verdana, sans-serif" size="2" >
222 <font color="#7dc857"><strong>Helpful Tips</strong></font>
223 <br /><br />
224 <font color="#3b5187">Tokens</font><br />
225 Click "Insert Tokens" to dynamically insert names, addresses, and other contact data of your recipients.
226 <br /><br />
227 <font color="#3b5187">Plain Text Version</font><br />
228 Some people refuse HTML emails altogether. We recommend sending a plain-text version of your important communications to accommodate them. Luckily, CiviCRM accommodates for this! Just click "Plain Text" and copy and paste in some text. Line breaks (carriage returns) and fully qualified URLs like http://www.example.com are all you get, no HTML here!
229 <br /><br />
230 <font color="#3b5187">Play by the Rules</font><br />
231 The address of the sender is required by the Can Spam Act law. This is an available token called domain.address. An unsubscribe or opt-out link is also required. There are several available tokens for this. <em>{literal}{action.optOutUrl}{/literal}</em> creates a link for recipients to click if they want to opt out of receiving emails from your organization. <em>{literal}{action.unsubscribeUrl}{/literal}</em> creates a link to unsubscribe from the specific mailing list used to send this message. Click on "Insert Tokens" to find these and look for tokens named "Domain" or "Unsubscribe". This sample template includes both required tokens at the bottom of the message. You can also configure a default Mailing Footer containing these tokens.
232 <br /><br />
233 <font color="#3b5187">Composing Offline</font><br />
234 If you prefer to compose an HTML email offline in your own text editor, you can upload this HTML content into CiviMail or simply click "Source" and then copy and paste the HTML in.
235 <br /><br />
236 <font color="#3b5187">Images</font><br />
237 Most email clients these days (Outlook, Gmail, etc) block image loading by default. This is to protect their users from annoying or harmful email. Not much we can do about this, so encourage recipients to add you to their contacts or "whitelist". Also use images sparingly, do not rely on images to convey vital information, and always use HTML "alt" tags which describe the image content.
238 </td>
239 </tr>
240 </table>
241 </td>
242 </tr>
243 <tr>
244 <td colspan="2" style="color: #000; font-family: Arial, Verdana, sans-serif; font-size: 10px;">
245 <font face="Arial, Verdana, sans-serif" size="2" >
246 <hr />
247 <a href="{literal}{action.unsubscribeUrl}{/literal}" title="click to unsubscribe">Click here</a> to unsubscribe from this mailing list.<br /><br />
248 Our mailing address is:<br />
249 {literal}{domain.address}{/literal}
250 </td>
251 </tr>
252 </table>', NULL, 1, 0);