Merge pull request #2240 from totten/4.4-setCriteriaModel
[civicrm-core.git] / xml / schema / Mailing / Mailing.xml
CommitLineData
6a488035
TO
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 </field>
102 <field>
103 <name>from_name</name>
104 <type>varchar</type>
105 <length>128</length>
106 <comment>From Header of mailing</comment>
107 </field>
108 <field>
109 <name>from_email</name>
110 <type>varchar</type>
111 <length>128</length>
112 <comment>From Email of mailing</comment>
113 </field>
114 <field>
115 <name>replyto_email</name>
116 <type>varchar</type>
117 <length>128</length>
118 <comment>Reply-To Email of mailing</comment>
119 </field>
120 <field>
121 <name>subject</name>
122 <type>varchar</type>
123 <length>128</length>
124 <comment>Subject of mailing</comment>
125 </field>
126 <field>
127 <name>body_text</name>
128 <type>longtext</type>
129 <comment>Body of the mailing in text format.</comment>
130 </field>
131 <field>
132 <name>body_html</name>
133 <type>longtext</type>
134 <comment>Body of the mailing in html format.</comment>
135 </field>
136 <field>
137 <name>url_tracking</name>
138 <type>boolean</type>
139 <comment>Should we track URL click-throughs for this mailing?</comment>
140 </field>
141 <field>
142 <name>forward_replies</name>
143 <type>boolean</type>
144 <comment>Should we forward replies back to the author?</comment>
145 </field>
146 <field>
147 <name>auto_responder</name>
148 <type>boolean</type>
149 <comment>Should we enable the auto-responder?</comment>
150 </field>
151 <field>
152 <name>open_tracking</name>
153 <type>boolean</type>
154 <comment>Should we track when recipients open/read this mailing?</comment>
155 </field>
156 <field>
157 <name>is_completed</name>
158 <type>boolean</type>
159 <comment>Has at least one job associated with this mailing finished?</comment>
160 </field>
161 <field>
162 <name>msg_template_id</name>
163 <type>int unsigned</type>
164 <comment>FK to the message template.</comment>
165 </field>
166 <foreignKey>
167 <name>msg_template_id</name>
168 <table>civicrm_msg_template</table>
169 <key>id</key>
170 <onDelete>SET NULL</onDelete>
171 </foreignKey>
172 <field>
173 <name>override_verp</name>
174 <type>boolean</type>
175 <default>0</default>
3c7d2158 176 <add>2.2</add>
6a488035
TO
177 <comment>Should we overrite VERP address in Reply-To</comment>
178 </field>
179 <field>
180 <name>created_id</name>
181 <type>int unsigned</type>
182 <comment>FK to Contact ID who first created this mailing</comment>
183 </field>
184 <foreignKey>
185 <name>created_id</name>
186 <table>civicrm_contact</table>
187 <key>id</key>
188 <onDelete>SET NULL</onDelete>
189 </foreignKey>
190 <field>
191 <name>created_date</name>
192 <type>datetime</type>
193 <title>Mailing Created Date</title>
194 <comment>Date and time this mailing was created.</comment>
195 <add>3.0</add>
196 </field>
197 <field>
198 <name>scheduled_id</name>
199 <type>int unsigned</type>
200 <comment>FK to Contact ID who scheduled this mailing</comment>
201 </field>
202 <foreignKey>
203 <name>scheduled_id</name>
204 <table>civicrm_contact</table>
205 <key>id</key>
206 <onDelete>SET NULL</onDelete>
207 </foreignKey>
208 <field>
209 <name>scheduled_date</name>
210 <type>datetime</type>
211 <title>Mailing Scheduled Date</title>
212 <comment>Date and time this mailing was scheduled.</comment>
213 <add>3.3</add>
214 </field>
215 <field>
216 <name>approver_id</name>
217 <type>int unsigned</type>
218 <comment>FK to Contact ID who approved this mailing</comment>
219 </field>
220 <foreignKey>
221 <name>approver_id</name>
222 <table>civicrm_contact</table>
223 <key>id</key>
224 <onDelete>SET NULL</onDelete>
225 </foreignKey>
226 <field>
227 <name>approval_date</name>
228 <type>datetime</type>
229 <title>Mailing Approved Date</title>
230 <comment>Date and time this mailing was approved.</comment>
231 <add>3.3</add>
232 </field>
233 <field>
234 <name>approval_status_id</name>
235 <type>int unsigned</type>
236 <title>Approval Status</title>
237 <comment>The status of this mailing. Values: none, approved, rejected</comment>
6ce01b02
CW
238 <pseudoconstant>
239 <optionGroupName>mail_approval_status</optionGroupName>
240 </pseudoconstant>
6a488035
TO
241 <add>3.3</add>
242 </field>
243 <field>
244 <name>approval_note</name>
245 <type>longtext</type>
246 <title>Approval Note</title>
247 <comment>Note behind the decision.</comment>
248 <add>3.3</add>
249 </field>
250 <field>
251 <name>is_archived</name>
252 <type>boolean</type>
253 <default>0</default>
254 <comment>Is this mailing archived?</comment>
255 <add>2.2</add>
256 </field>
3c7d2158 257 <field>
258 <name>visibility</name>
259 <type>enum</type>
260 <values>User and User Admin Only,Public Pages</values>
261 <default>'User and User Admin Only'</default>
262 <comment>In what context(s) is the mailing contents visible (online viewing)</comment>
263 <add>3.3</add>
264 </field>
265 <field>
266 <name>campaign_id</name>
267 <type>int unsigned</type>
268 <comment>The campaign for which this mailing has been initiated.</comment>
3e3eacd0
CW
269 <pseudoconstant>
270 <table>civicrm_campaign</table>
271 <keyColumn>id</keyColumn>
272 <labelColumn>title</labelColumn>
273 <condition>(end_date IS NULL OR end_date > NOW())</condition>
274 </pseudoconstant>
3c7d2158 275 <add>3.4</add>
276 </field>
277 <foreignKey>
278 <name>campaign_id</name>
279 <table>civicrm_campaign</table>
280 <key>id</key>
6a488035
TO
281 <onDelete>SET NULL</onDelete>
282 </foreignKey>
283 <field>
284 <name>dedupe_email</name>
285 <type>boolean</type>
286 <default>0</default>
3c7d2158 287 <add>4.1</add>
6a488035
TO
288 <comment>Remove duplicate emails?</comment>
289 </field>
3c7d2158 290 <field>
291 <name>sms_provider_id</name>
292 <type>int unsigned</type>
293 <add>4.2</add>
294 </field>
295 <foreignKey>
296 <name>sms_provider_id</name>
297 <table>civicrm_sms_provider</table>
298 <key>id</key>
6a488035
TO
299 <onDelete>SET NULL</onDelete>
300 <add>4.2</add>
301 </foreignKey>
302</table>