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