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