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