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