Merge pull request #3309 from monishdeb/CRM-14627
[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 <type>int unsigned</type>
12 <required>true</required>
13 </field>
14 <primaryKey>
15 <name>id</name>
16 <autoincrement>true</autoincrement>
17 </primaryKey>
18 <field>
19 <name>domain_id</name>
20 <type>int unsigned</type>
21 <comment>Which site is this mailing for</comment>
22 <add>3.4</add>
23 </field>
24 <foreignKey>
25 <name>domain_id</name>
26 <table>civicrm_domain</table>
27 <key>id</key>
28 <onDelete>SET NULL</onDelete>
29 <add>3.4</add>
30 </foreignKey>
31 <field>
32 <name>header_id</name>
33 <type>int unsigned</type>
34 <comment>FK to the header component.</comment>
35 </field>
36 <foreignKey>
37 <name>header_id</name>
38 <table>civicrm_mailing_component</table>
39 <key>id</key>
40 <onDelete>SET NULL</onDelete>
41 </foreignKey>
42 <field>
43 <name>footer_id</name>
44 <type>int unsigned</type>
45 <comment>FK to the footer component.</comment>
46 </field>
47 <foreignKey>
48 <name>footer_id</name>
49 <table>civicrm_mailing_component</table>
50 <key>id</key>
51 <onDelete>SET NULL</onDelete>
52 </foreignKey>
53 <field>
54 <name>reply_id</name>
55 <type>int unsigned</type>
56 <comment>FK to the auto-responder component.</comment>
57 </field>
58 <foreignKey>
59 <name>reply_id</name>
60 <table>civicrm_mailing_component</table>
61 <key>id</key>
62 <onDelete>SET NULL</onDelete>
63 </foreignKey>
64 <field>
65 <name>unsubscribe_id</name>
66 <type>int unsigned</type>
67 <comment>FK to the unsubscribe component.</comment>
68 </field>
69 <foreignKey>
70 <name>unsubscribe_id</name>
71 <table>civicrm_mailing_component</table>
72 <key>id</key>
73 <onDelete>SET NULL</onDelete>
74 </foreignKey>
75 <field>
76 <name>resubscribe_id</name>
77 <type>int unsigned</type>
78 </field>
79 <foreignKey>
80 <name>optout_id</name>
81 <table>civicrm_mailing_component</table>
82 <key>id</key>
83 <onDelete>SET NULL</onDelete>
84 </foreignKey>
85 <field>
86 <name>optout_id</name>
87 <type>int unsigned</type>
88 <comment>FK to the opt-out component.</comment>
89 </field>
90 <foreignKey>
91 <name>optout_id</name>
92 <table>civicrm_mailing_component</table>
93 <key>id</key>
94 <onDelete>SET NULL</onDelete>
95 </foreignKey>
96 <field>
97 <name>name</name>
98 <type>varchar</type>
99 <length>128</length>
100 <comment>Mailing Name.</comment>
101 <html>
102 <type>Text</type>
103 </html>
104 </field>
105 <field>
106 <name>from_name</name>
107 <type>varchar</type>
108 <length>128</length>
109 <comment>From Header of mailing</comment>
110 <html>
111 <type>Text</type>
112 </html>
113 </field>
114 <field>
115 <name>from_email</name>
116 <type>varchar</type>
117 <length>128</length>
118 <comment>From Email of mailing</comment>
119 <html>
120 <type>Text</type>
121 </html>
122 </field>
123 <field>
124 <name>replyto_email</name>
125 <type>varchar</type>
126 <length>128</length>
127 <comment>Reply-To Email of mailing</comment>
128 <html>
129 <type>Text</type>
130 </html>
131 </field>
132 <field>
133 <name>subject</name>
134 <type>varchar</type>
135 <length>128</length>
136 <comment>Subject of mailing</comment>
137 <html>
138 <type>Text</type>
139 </html>
140 </field>
141 <field>
142 <name>body_text</name>
143 <type>longtext</type>
144 <comment>Body of the mailing in text format.</comment>
145 </field>
146 <field>
147 <name>body_html</name>
148 <type>longtext</type>
149 <comment>Body of the mailing in html format.</comment>
150 </field>
151 <field>
152 <name>url_tracking</name>
153 <type>boolean</type>
154 <comment>Should we track URL click-throughs for this mailing?</comment>
155 <html>
156 <type>CheckBox</type>
157 </html>
158 </field>
159 <field>
160 <name>forward_replies</name>
161 <type>boolean</type>
162 <comment>Should we forward replies back to the author?</comment>
163 <html>
164 <type>CheckBox</type>
165 </html>
166 </field>
167 <field>
168 <name>auto_responder</name>
169 <type>boolean</type>
170 <comment>Should we enable the auto-responder?</comment>
171 <html>
172 <type>CheckBox</type>
173 </html>
174 </field>
175 <field>
176 <name>open_tracking</name>
177 <type>boolean</type>
178 <comment>Should we track when recipients open/read this mailing?</comment>
179 </field>
180 <field>
181 <name>is_completed</name>
182 <type>boolean</type>
183 <comment>Has at least one job associated with this mailing finished?</comment>
184 <html>
185 <type>CheckBox</type>
186 </html>
187 </field>
188 <field>
189 <name>msg_template_id</name>
190 <type>int unsigned</type>
191 <comment>FK to the message template.</comment>
192 </field>
193 <foreignKey>
194 <name>msg_template_id</name>
195 <table>civicrm_msg_template</table>
196 <key>id</key>
197 <onDelete>SET NULL</onDelete>
198 </foreignKey>
199 <field>
200 <name>override_verp</name>
201 <type>boolean</type>
202 <default>0</default>
203 <add>2.2</add>
204 <comment>Should we overrite VERP address in Reply-To</comment>
205 <html>
206 <type>CheckBox</type>
207 </html>
208 </field>
209 <field>
210 <name>created_id</name>
211 <type>int unsigned</type>
212 <comment>FK to Contact ID who first created this mailing</comment>
213 </field>
214 <foreignKey>
215 <name>created_id</name>
216 <table>civicrm_contact</table>
217 <key>id</key>
218 <onDelete>SET NULL</onDelete>
219 </foreignKey>
220 <field>
221 <name>created_date</name>
222 <type>datetime</type>
223 <title>Mailing Created Date</title>
224 <comment>Date and time this mailing was created.</comment>
225 <add>3.0</add>
226 <html>
227 <type>Select Date</type>
228 </html>
229 </field>
230 <field>
231 <name>scheduled_id</name>
232 <type>int unsigned</type>
233 <comment>FK to Contact ID who scheduled this mailing</comment>
234 </field>
235 <foreignKey>
236 <name>scheduled_id</name>
237 <table>civicrm_contact</table>
238 <key>id</key>
239 <onDelete>SET NULL</onDelete>
240 </foreignKey>
241 <field>
242 <name>scheduled_date</name>
243 <type>datetime</type>
244 <title>Mailing Scheduled Date</title>
245 <comment>Date and time this mailing was scheduled.</comment>
246 <add>3.3</add>
247 </field>
248 <field>
249 <name>approver_id</name>
250 <type>int unsigned</type>
251 <comment>FK to Contact ID who approved this mailing</comment>
252 </field>
253 <foreignKey>
254 <name>approver_id</name>
255 <table>civicrm_contact</table>
256 <key>id</key>
257 <onDelete>SET NULL</onDelete>
258 </foreignKey>
259 <field>
260 <name>approval_date</name>
261 <type>datetime</type>
262 <title>Mailing Approved Date</title>
263 <comment>Date and time this mailing was approved.</comment>
264 <add>3.3</add>
265 </field>
266 <field>
267 <name>approval_status_id</name>
268 <type>int unsigned</type>
269 <title>Approval Status</title>
270 <comment>The status of this mailing. Values: none, approved, rejected</comment>
271 <pseudoconstant>
272 <optionGroupName>mail_approval_status</optionGroupName>
273 </pseudoconstant>
274 <html>
275 <type>Select</type>
276 </html>
277 <add>3.3</add>
278 </field>
279 <field>
280 <name>approval_note</name>
281 <type>longtext</type>
282 <title>Approval Note</title>
283 <comment>Note behind the decision.</comment>
284 <add>3.3</add>
285 <html>
286 <type>TextArea</type>
287 </html>
288 </field>
289 <field>
290 <name>is_archived</name>
291 <type>boolean</type>
292 <default>0</default>
293 <comment>Is this mailing archived?</comment>
294 <html>
295 <type>CheckBox</type>
296 </html>
297 <add>2.2</add>
298 </field>
299 <field>
300 <name>visibility</name>
301 <type>varchar</type>
302 <length>40</length>
303 <default>'User and User Admin Only'</default>
304 <comment>In what context(s) is the mailing contents visible (online viewing)</comment>
305 <pseudoconstant>
306 <callback>CRM_Core_SelectValues::groupVisibility</callback>
307 </pseudoconstant>
308 <add>3.3</add>
309 <html>
310 <type>Select</type>
311 </html>
312 </field>
313 <field>
314 <name>campaign_id</name>
315 <type>int unsigned</type>
316 <comment>The campaign for which this mailing has been initiated.</comment>
317 <pseudoconstant>
318 <table>civicrm_campaign</table>
319 <keyColumn>id</keyColumn>
320 <labelColumn>title</labelColumn>
321 </pseudoconstant>
322 <add>3.4</add>
323 <html>
324 <type>Select</type>
325 </html>
326 </field>
327 <foreignKey>
328 <name>campaign_id</name>
329 <table>civicrm_campaign</table>
330 <key>id</key>
331 <onDelete>SET NULL</onDelete>
332 </foreignKey>
333 <field>
334 <name>dedupe_email</name>
335 <type>boolean</type>
336 <default>0</default>
337 <add>4.1</add>
338 <comment>Remove duplicate emails?</comment>
339 <html>
340 <type>CheckBox</type>
341 </html>
342 </field>
343 <field>
344 <name>sms_provider_id</name>
345 <type>int unsigned</type>
346 <add>4.2</add>
347 <html>
348 <type>Select</type>
349 </html>
350 </field>
351 <foreignKey>
352 <name>sms_provider_id</name>
353 <table>civicrm_sms_provider</table>
354 <key>id</key>
355 <onDelete>SET NULL</onDelete>
356 <add>4.2</add>
357 </foreignKey>
358 <field>
359 <name>hash</name>
360 <title>Mailing Hash</title>
361 <type>varchar</type>
362 <length>16</length>
363 <comment>Key for validating requests related to this mailing.</comment>
364 <add>4.5</add>
365 </field>
366 <index>
367 <name>index_hash</name>
368 <fieldName>hash</fieldName>
369 <add>4.5</add>
370 </index>
371 </table>