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