Merge pull request #15746 from civicrm/5.19
[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 <uniqueName>mailing_name</uniqueName>
124 <title>Mailing Name</title>
125 <type>varchar</type>
126 <length>128</length>
127 <comment>Mailing Name.</comment>
128 <html>
129 <type>Text</type>
130 </html>
131 </field>
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>
146 <field>
147 <name>from_name</name>
148 <title>Mailing From Name</title>
149 <type>varchar</type>
150 <length>128</length>
151 <comment>From Header of mailing</comment>
152 <html>
153 <type>Text</type>
154 </html>
155 </field>
156 <field>
157 <name>from_email</name>
158 <title>Mailing From Email</title>
159 <type>varchar</type>
160 <length>128</length>
161 <comment>From Email of mailing</comment>
162 <html>
163 <type>Text</type>
164 </html>
165 </field>
166 <field>
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>
174 </field>
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>
193 <field>
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>
201 </field>
202 <field>
203 <name>body_text</name>
204 <type>longtext</type>
205 <comment>Body of the mailing in text format.</comment>
206 </field>
207 <field>
208 <name>body_html</name>
209 <type>longtext</type>
210 <comment>Body of the mailing in html format.</comment>
211 </field>
212 <field>
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>
219 </field>
220 <field>
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>
227 </field>
228 <field>
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>
235 </field>
236 <field>
237 <name>open_tracking</name>
238 <title>Track Mailing?</title>
239 <type>boolean</type>
240 <comment>Should we track when recipients open/read this mailing?</comment>
241 </field>
242 <field>
243 <name>is_completed</name>
244 <title>Mailing Completed</title>
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>
250 </field>
251 <field>
252 <name>msg_template_id</name>
253 <title>Mailing Message Template</title>
254 <type>int unsigned</type>
255 <comment>FK to the message template.</comment>
256 </field>
257 <foreignKey>
258 <name>msg_template_id</name>
259 <table>civicrm_msg_template</table>
260 <key>id</key>
261 <onDelete>SET NULL</onDelete>
262 </foreignKey>
263 <field>
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>
272 </field>
273 <field>
274 <name>created_id</name>
275 <title>Mailing Creator</title>
276 <type>int unsigned</type>
277 <comment>FK to Contact ID who first created this mailing</comment>
278 </field>
279 <foreignKey>
280 <name>created_id</name>
281 <table>civicrm_contact</table>
282 <key>id</key>
283 <onDelete>SET NULL</onDelete>
284 </foreignKey>
285 <field>
286 <name>created_date</name>
287 <type>timestamp</type>
288 <default>NULL</default>
289 <required>false</required>
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>
295 <formatType>activityDateTime</formatType>
296 </html>
297 </field>
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>
308 <field>
309 <name>scheduled_id</name>
310 <title>Scheduled By</title>
311 <type>int unsigned</type>
312 <comment>FK to Contact ID who scheduled this mailing</comment>
313 </field>
314 <foreignKey>
315 <name>scheduled_id</name>
316 <table>civicrm_contact</table>
317 <key>id</key>
318 <onDelete>SET NULL</onDelete>
319 </foreignKey>
320 <field>
321 <name>scheduled_date</name>
322 <type>timestamp</type>
323 <default>NULL</default>
324 <required>false</required>
325 <title>Mailing Scheduled Date</title>
326 <comment>Date and time this mailing was scheduled.</comment>
327 <add>3.3</add>
328 <html>
329 <type>Select Date</type>
330 <formatType>activityDateTime</formatType>
331 </html>
332 </field>
333 <field>
334 <name>approver_id</name>
335 <title>Approved By</title>
336 <type>int unsigned</type>
337 <comment>FK to Contact ID who approved this mailing</comment>
338 </field>
339 <foreignKey>
340 <name>approver_id</name>
341 <table>civicrm_contact</table>
342 <key>id</key>
343 <onDelete>SET NULL</onDelete>
344 </foreignKey>
345 <field>
346 <name>approval_date</name>
347 <type>timestamp</type>
348 <default>NULL</default>
349 <required>false</required>
350 <title>Mailing Approved Date</title>
351 <comment>Date and time this mailing was approved.</comment>
352 <add>3.3</add>
353 <html>
354 <type>Select Date</type>
355 <formatType>activityDateTime</formatType>
356 </html>
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>
384 <title>Is Mailing Archived?</title>
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>
395 <title>Mailing Visibility</title>
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>
410 <title>Mailing Campaign</title>
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>
421 </field>
422 <foreignKey>
423 <name>campaign_id</name>
424 <table>civicrm_campaign</table>
425 <key>id</key>
426 <onDelete>SET NULL</onDelete>
427 </foreignKey>
428 <field>
429 <name>dedupe_email</name>
430 <type>boolean</type>
431 <title>No Duplicate emails?</title>
432 <default>0</default>
433 <add>4.1</add>
434 <comment>Remove duplicate emails?</comment>
435 <html>
436 <type>CheckBox</type>
437 </html>
438 </field>
439 <field>
440 <name>sms_provider_id</name>
441 <title>Mailing SMS Provider</title>
442 <type>int unsigned</type>
443 <add>4.2</add>
444 <html>
445 <type>Select</type>
446 </html>
447 </field>
448 <foreignKey>
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>
454 </foreignKey>
455 <field>
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>
462 </field>
463 <index>
464 <name>index_hash</name>
465 <fieldName>hash</fieldName>
466 <add>4.5</add>
467 </index>
468 <field>
469 <name>location_type_id</name>
470 <title>Location Type</title>
471 <type>int unsigned</type>
472 <comment>With email_selection_method, determines which email address to use</comment>
473 <pseudoconstant>
474 <table>civicrm_location_type</table>
475 <keyColumn>id</keyColumn>
476 <labelColumn>display_name</labelColumn>
477 </pseudoconstant>
478 <add>4.6</add>
479 </field>
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>
487 <field>
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>
493 <pseudoconstant>
494 <callback>CRM_Core_SelectValues::emailSelectMethods</callback>
495 </pseudoconstant>
496 <add>4.6</add>
497 </field>
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>
513 </table>