Use standard names from CRM_Core_Action for entity paths and add a few more paths
[civicrm-core.git] / xml / schema / Mailing / Mailing.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Mailing</base>
5 <class>Mailing</class>
6 <name>civicrm_mailing</name>
7 <comment>Stores information about a mailing.</comment>
8 <archive>true</archive>
9 <icon>fa-envelope-o</icon>
10 <paths>
11 <add>civicrm/a/#/mailing/new</add>
12 <update>civicrm/a/#/mailing/[id]</update>
13 </paths>
14 <field>
15 <name>id</name>
16 <title>Mailing ID</title>
17 <type>int unsigned</type>
18 <required>true</required>
19 </field>
20 <primaryKey>
21 <name>id</name>
22 <autoincrement>true</autoincrement>
23 </primaryKey>
24 <field>
25 <name>domain_id</name>
26 <title>Mailing Domain</title>
27 <type>int unsigned</type>
28 <pseudoconstant>
29 <table>civicrm_domain</table>
30 <keyColumn>id</keyColumn>
31 <labelColumn>name</labelColumn>
32 </pseudoconstant>
33 <comment>Which site is this mailing for</comment>
34 <add>3.4</add>
35 </field>
36 <foreignKey>
37 <name>domain_id</name>
38 <table>civicrm_domain</table>
39 <key>id</key>
40 <onDelete>SET NULL</onDelete>
41 <add>3.4</add>
42 </foreignKey>
43 <field>
44 <name>header_id</name>
45 <title>Mailing Header</title>
46 <type>int unsigned</type>
47 <pseudoconstant>
48 <table>civicrm_mailing_component</table>
49 <keyColumn>id</keyColumn>
50 <labelColumn>name</labelColumn>
51 <condition>component_type = "Header"</condition>
52 </pseudoconstant>
53 <comment>FK to the header component.</comment>
54 </field>
55 <foreignKey>
56 <name>header_id</name>
57 <table>civicrm_mailing_component</table>
58 <key>id</key>
59 <onDelete>SET NULL</onDelete>
60 </foreignKey>
61 <field>
62 <name>footer_id</name>
63 <title>Mailing Footer</title>
64 <type>int unsigned</type>
65 <pseudoconstant>
66 <table>civicrm_mailing_component</table>
67 <keyColumn>id</keyColumn>
68 <labelColumn>name</labelColumn>
69 <condition>component_type = "Footer"</condition>
70 </pseudoconstant>
71 <comment>FK to the footer component.</comment>
72 </field>
73 <foreignKey>
74 <name>footer_id</name>
75 <table>civicrm_mailing_component</table>
76 <key>id</key>
77 <onDelete>SET NULL</onDelete>
78 </foreignKey>
79 <field>
80 <name>reply_id</name>
81 <title>Mailing Reply</title>
82 <type>int unsigned</type>
83 <comment>FK to the auto-responder component.</comment>
84 </field>
85 <foreignKey>
86 <name>reply_id</name>
87 <table>civicrm_mailing_component</table>
88 <key>id</key>
89 <onDelete>SET NULL</onDelete>
90 </foreignKey>
91 <field>
92 <name>unsubscribe_id</name>
93 <title>Mailing Unsubscribe</title>
94 <type>int unsigned</type>
95 <comment>FK to the unsubscribe component.</comment>
96 </field>
97 <foreignKey>
98 <name>unsubscribe_id</name>
99 <table>civicrm_mailing_component</table>
100 <key>id</key>
101 <onDelete>SET NULL</onDelete>
102 </foreignKey>
103 <field>
104 <name>resubscribe_id</name>
105 <title>Mailing Resubscribe</title>
106 <type>int unsigned</type>
107 </field>
108 <foreignKey>
109 <name>optout_id</name>
110 <table>civicrm_mailing_component</table>
111 <key>id</key>
112 <onDelete>SET NULL</onDelete>
113 </foreignKey>
114 <field>
115 <name>optout_id</name>
116 <title>Mailing Opt Out</title>
117 <type>int unsigned</type>
118 <comment>FK to the opt-out component.</comment>
119 </field>
120 <foreignKey>
121 <name>optout_id</name>
122 <table>civicrm_mailing_component</table>
123 <key>id</key>
124 <onDelete>SET NULL</onDelete>
125 </foreignKey>
126 <field>
127 <name>name</name>
128 <uniqueName>mailing_name</uniqueName>
129 <title>Mailing Name</title>
130 <type>varchar</type>
131 <length>128</length>
132 <comment>Mailing Name.</comment>
133 <html>
134 <type>Text</type>
135 </html>
136 </field>
137 <field>
138 <name>mailing_type</name>
139 <type>varchar</type>
140 <title>Mailing Type</title>
141 <length>32</length>
142 <comment>differentiate between standalone mailings, A/B tests, and A/B final-winner</comment>
143 <pseudoconstant>
144 <callback>CRM_Mailing_PseudoConstant::mailingTypes</callback>
145 </pseudoconstant>
146 <add>4.6</add>
147 <html>
148 <type>Select</type>
149 </html>
150 </field>
151 <field>
152 <name>from_name</name>
153 <title>Mailing From Name</title>
154 <type>varchar</type>
155 <length>128</length>
156 <comment>From Header of mailing</comment>
157 <html>
158 <type>Text</type>
159 </html>
160 </field>
161 <field>
162 <name>from_email</name>
163 <title>Mailing From Email</title>
164 <type>varchar</type>
165 <length>128</length>
166 <comment>From Email of mailing</comment>
167 <html>
168 <type>Text</type>
169 </html>
170 </field>
171 <field>
172 <name>replyto_email</name>
173 <type>varchar</type>
174 <length>128</length>
175 <comment>Reply-To Email of mailing</comment>
176 <html>
177 <type>Text</type>
178 </html>
179 </field>
180 <field>
181 <name>template_type</name>
182 <title>Template Type</title>
183 <type>varchar</type>
184 <length>64</length>
185 <default>'traditional'</default>
186 <required>true</required>
187 <comment>The language/processing system used for email templates.</comment>
188 <pseudoconstant>
189 <callback>CRM_Mailing_BAO_Mailing::getTemplateTypeNames</callback>
190 </pseudoconstant>
191 </field>
192 <field>
193 <name>template_options</name>
194 <title>Template Options (JSON)</title>
195 <type>longtext</type>
196 <comment>Advanced options used by the email templating system. (JSON encoded)</comment>
197 </field>
198 <field>
199 <name>subject</name>
200 <type>varchar</type>
201 <length>128</length>
202 <comment>Subject of mailing</comment>
203 <html>
204 <type>Text</type>
205 </html>
206 </field>
207 <field>
208 <name>body_text</name>
209 <type>longtext</type>
210 <comment>Body of the mailing in text format.</comment>
211 </field>
212 <field>
213 <name>body_html</name>
214 <type>longtext</type>
215 <comment>Body of the mailing in html format.</comment>
216 </field>
217 <field>
218 <name>url_tracking</name>
219 <type>boolean</type>
220 <comment>Should we track URL click-throughs for this mailing?</comment>
221 <html>
222 <type>CheckBox</type>
223 </html>
224 </field>
225 <field>
226 <name>forward_replies</name>
227 <type>boolean</type>
228 <comment>Should we forward replies back to the author?</comment>
229 <html>
230 <type>CheckBox</type>
231 </html>
232 </field>
233 <field>
234 <name>auto_responder</name>
235 <type>boolean</type>
236 <comment>Should we enable the auto-responder?</comment>
237 <html>
238 <type>CheckBox</type>
239 </html>
240 </field>
241 <field>
242 <name>open_tracking</name>
243 <title>Track Mailing?</title>
244 <type>boolean</type>
245 <comment>Should we track when recipients open/read this mailing?</comment>
246 </field>
247 <field>
248 <name>is_completed</name>
249 <title>Mailing Completed</title>
250 <type>boolean</type>
251 <comment>Has at least one job associated with this mailing finished?</comment>
252 <html>
253 <type>CheckBox</type>
254 </html>
255 </field>
256 <field>
257 <name>msg_template_id</name>
258 <title>Mailing Message Template</title>
259 <type>int unsigned</type>
260 <comment>FK to the message template.</comment>
261 </field>
262 <foreignKey>
263 <name>msg_template_id</name>
264 <table>civicrm_msg_template</table>
265 <key>id</key>
266 <onDelete>SET NULL</onDelete>
267 </foreignKey>
268 <field>
269 <name>override_verp</name>
270 <type>boolean</type>
271 <default>0</default>
272 <add>2.2</add>
273 <comment>Overwrite the VERP address in Reply-To</comment>
274 <html>
275 <type>CheckBox</type>
276 </html>
277 </field>
278 <field>
279 <name>created_id</name>
280 <title>Mailing Creator</title>
281 <type>int unsigned</type>
282 <comment>FK to Contact ID who first created this mailing</comment>
283 </field>
284 <foreignKey>
285 <name>created_id</name>
286 <table>civicrm_contact</table>
287 <key>id</key>
288 <onDelete>SET NULL</onDelete>
289 </foreignKey>
290 <field>
291 <name>created_date</name>
292 <type>timestamp</type>
293 <default>NULL</default>
294 <required>false</required>
295 <title>Mailing Created Date</title>
296 <comment>Date and time this mailing was created.</comment>
297 <add>3.0</add>
298 <html>
299 <type>Select Date</type>
300 <formatType>activityDateTime</formatType>
301 </html>
302 </field>
303 <field>
304 <name>modified_date</name>
305 <uniqueName>mailing_modified_date</uniqueName>
306 <type>timestamp</type>
307 <comment>When the mailing (or closely related entity) was created or modified or deleted.</comment>
308 <required>false</required>
309 <export>true</export>
310 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
311 <add>4.7</add>
312 </field>
313 <field>
314 <name>scheduled_id</name>
315 <title>Scheduled By</title>
316 <type>int unsigned</type>
317 <comment>FK to Contact ID who scheduled this mailing</comment>
318 </field>
319 <foreignKey>
320 <name>scheduled_id</name>
321 <table>civicrm_contact</table>
322 <key>id</key>
323 <onDelete>SET NULL</onDelete>
324 </foreignKey>
325 <field>
326 <name>scheduled_date</name>
327 <type>timestamp</type>
328 <default>NULL</default>
329 <required>false</required>
330 <title>Mailing Scheduled Date</title>
331 <comment>Date and time this mailing was scheduled.</comment>
332 <add>3.3</add>
333 <html>
334 <type>Select Date</type>
335 <formatType>activityDateTime</formatType>
336 </html>
337 </field>
338 <field>
339 <name>approver_id</name>
340 <title>Approved By</title>
341 <type>int unsigned</type>
342 <comment>FK to Contact ID who approved this mailing</comment>
343 </field>
344 <foreignKey>
345 <name>approver_id</name>
346 <table>civicrm_contact</table>
347 <key>id</key>
348 <onDelete>SET NULL</onDelete>
349 </foreignKey>
350 <field>
351 <name>approval_date</name>
352 <type>timestamp</type>
353 <default>NULL</default>
354 <required>false</required>
355 <title>Mailing Approved Date</title>
356 <comment>Date and time this mailing was approved.</comment>
357 <add>3.3</add>
358 <html>
359 <type>Select Date</type>
360 <formatType>activityDateTime</formatType>
361 </html>
362 </field>
363 <field>
364 <name>approval_status_id</name>
365 <type>int unsigned</type>
366 <title>Approval Status</title>
367 <comment>The status of this mailing. Values: none, approved, rejected</comment>
368 <pseudoconstant>
369 <optionGroupName>mail_approval_status</optionGroupName>
370 </pseudoconstant>
371 <html>
372 <type>Select</type>
373 </html>
374 <add>3.3</add>
375 </field>
376 <field>
377 <name>approval_note</name>
378 <type>longtext</type>
379 <title>Approval Note</title>
380 <comment>Note behind the decision.</comment>
381 <add>3.3</add>
382 <html>
383 <type>TextArea</type>
384 </html>
385 </field>
386 <field>
387 <name>is_archived</name>
388 <type>boolean</type>
389 <title>Is Mailing Archived?</title>
390 <default>0</default>
391 <comment>Is this mailing archived?</comment>
392 <html>
393 <type>CheckBox</type>
394 </html>
395 <add>2.2</add>
396 </field>
397 <field>
398 <name>visibility</name>
399 <type>varchar</type>
400 <title>Mailing Visibility</title>
401 <length>40</length>
402 <default>'Public Pages'</default>
403 <comment>In what context(s) is the mailing contents visible (online viewing)</comment>
404 <pseudoconstant>
405 <callback>CRM_Core_SelectValues::groupVisibility</callback>
406 </pseudoconstant>
407 <add>3.3</add>
408 <html>
409 <type>Select</type>
410 </html>
411 </field>
412 <field>
413 <name>campaign_id</name>
414 <type>int unsigned</type>
415 <title>Mailing Campaign</title>
416 <comment>The campaign for which this mailing has been initiated.</comment>
417 <pseudoconstant>
418 <table>civicrm_campaign</table>
419 <keyColumn>id</keyColumn>
420 <labelColumn>title</labelColumn>
421 </pseudoconstant>
422 <add>3.4</add>
423 <html>
424 <type>Select</type>
425 </html>
426 </field>
427 <foreignKey>
428 <name>campaign_id</name>
429 <table>civicrm_campaign</table>
430 <key>id</key>
431 <onDelete>SET NULL</onDelete>
432 </foreignKey>
433 <field>
434 <name>dedupe_email</name>
435 <type>boolean</type>
436 <title>No Duplicate emails?</title>
437 <default>0</default>
438 <add>4.1</add>
439 <comment>Remove duplicate emails?</comment>
440 <html>
441 <type>CheckBox</type>
442 </html>
443 </field>
444 <field>
445 <name>sms_provider_id</name>
446 <title>Mailing SMS Provider</title>
447 <type>int unsigned</type>
448 <add>4.2</add>
449 <html>
450 <type>Select</type>
451 </html>
452 </field>
453 <foreignKey>
454 <name>sms_provider_id</name>
455 <table>civicrm_sms_provider</table>
456 <key>id</key>
457 <onDelete>SET NULL</onDelete>
458 <add>4.2</add>
459 </foreignKey>
460 <field>
461 <name>hash</name>
462 <title>Mailing Hash</title>
463 <type>varchar</type>
464 <length>16</length>
465 <comment>Key for validating requests related to this mailing.</comment>
466 <add>4.5</add>
467 </field>
468 <index>
469 <name>index_hash</name>
470 <fieldName>hash</fieldName>
471 <add>4.5</add>
472 </index>
473 <field>
474 <name>location_type_id</name>
475 <title>Location Type</title>
476 <type>int unsigned</type>
477 <comment>With email_selection_method, determines which email address to use</comment>
478 <pseudoconstant>
479 <table>civicrm_location_type</table>
480 <keyColumn>id</keyColumn>
481 <labelColumn>display_name</labelColumn>
482 </pseudoconstant>
483 <add>4.6</add>
484 </field>
485 <foreignKey>
486 <name>location_type_id</name>
487 <table>civicrm_location_type</table>
488 <key>id</key>
489 <onDelete>SET NULL</onDelete>
490 <add>4.6</add>
491 </foreignKey>
492 <field>
493 <name>email_selection_method</name>
494 <type>varchar</type>
495 <length>20</length>
496 <default>'automatic'</default>
497 <comment>With location_type_id, determine how to choose the email address to use.</comment>
498 <pseudoconstant>
499 <callback>CRM_Core_SelectValues::emailSelectMethods</callback>
500 </pseudoconstant>
501 <add>4.6</add>
502 </field>
503 <field>
504 <name>language</name>
505 <title>Mailing Language</title>
506 <type>varchar</type>
507 <length>5</length>
508 <comment>Language of the content of the mailing. Useful for tokens.</comment>
509 <add>4.6</add>
510 <pseudoconstant>
511 <optionGroupName>languages</optionGroupName>
512 <keyColumn>name</keyColumn>
513 </pseudoconstant>
514 <html>
515 <type>Select</type>
516 </html>
517 </field>
518 </table>