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