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