forked from sendgrid/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapps.html
More file actions
541 lines (475 loc) · 13.4 KB
/
Copy pathapps.html
File metadata and controls
541 lines (475 loc) · 13.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
---
layout: page
weight: 0
title: Settings (Filters)
navigation:
show: true
---
<p>Following are the settings that can be specified in the filters section of the X-SMTPAPI header. All filters and setting names must be lowercase.</p>
{% info %}
<ul>
<li>If you're enabling a Setting, also called a filter, via SMTPAPI, you are required to define all of the parameters for that Setting.</li>
<li>Setting enabled status will always default to your settings on the website, unless otherwise defined in your X-SMTPAPI header</li>
<li>If you enable a disabled setting, our system will not pull your settings for the disabled setting. You will need to define the settings in your X-SMTPAPI header <em>Example:</em> If you have a footer designed but disabled, you can't just enable it via the API; you need to define the footer in the API call itself.</li>
<li>All filter names and setting names must be lowercase.</li>
</ul>
{% endinfo %}
<p>For more information on the utility of these settings, please check out the <a href="{{root_url}}/User_Guide/Settings/">Settings</a> section.</p>
{% info %}
Some Settings are not listed here, because they cannot be defined on a per-message basis. To update these other Settings, please refer to the
<a href="{{root_url}}/API_Reference/Web_API/filter_settings.html">Web API Filter Settings</a> commands.
{% endinfo %}
{% anchor h3 bcc %}
Filter: <code>bcc</code>
{% endanchor %}
<p>Sends a BCC copy of the email created in this transaction to the address specified.</p>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<th>Parameter Name</th>
<th>Parameter Value</th>
<th>Parameter Description</th>
</tr>
<tr>
<td>enable</td>
<td><code>0</code> | <code>1</code></td>
<td>Disable or enable this Setting</td>
</tr>
<tr>
<td>email</td>
<td><code>email</code></td>
<td>email address destination for the bcc message</td>
</tr>
</tbody>
</table>
{% codeblock lang:json %}
{
"filters" : {
"bcc" : {
"settings" : {
"enable" : 1,
"email" : "example@example.com"
}
}
}
}
{% endcodeblock %}
<hr/>
{% anchor h3 bypass_list_management %}
Filter: <code>bypass_list_management</code>
{% endanchor %}
{% warning %}
This setting is very powerful, and can only be used on a per-message basis. Use with extreme caution.
{% endwarning %}
<p>Some emails are too important to do normal list management checks, such as password resets or critical alerts. Enabling this filter will bypass the normal unsubscribe / bounce / spam report checks and queue the email for delivery.</p>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<th>Parameter Name</th>
<th>Parameter Value</th>
<th>Parameter Description</th>
</tr>
<tr>
<td>enable</td>
<td><code>0</code> | <code>1</code></td>
<td>Disable or enable this Setting</td>
</tr>
</tbody>
</table>
{% codeblock lang:json %}
{
"filters" : {
"bypass_list_management" : {
"settings" : {
"enable" : 1
}
}
}
}
{% endcodeblock %}
<hr />
{% anchor h3 clicktrack %}
Filter: <code>clicktrack</code>
{% endanchor %}
<p>Rewrites links in email text and html bodies to go through our webservers, allowing for tracking when a link is clicked on.</p>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<th>Parameter Name</th>
<th>Parameter Value</th>
<th>Parameter Description</th>
</tr>
<tr>
<td>enable</td>
<td><code>0</code> | <code>1</code></td>
<td>Disable or enable this Setting</td>
</tr>
</tbody>
</table>
<h4>Example X-SMTPAPI Header Value</h4>
{% codeblock lang:json %}
{
"filters" : {
"clicktrack" : {
"settings" : {
"enable" : 1
}
}
}
}
{% endcodeblock %}
<hr/>
{% anchor h3 dkim %}
Filter: <code>dkim</code>
{% endanchor %}
<p>Allows you to specify the domain to use to sign messages with DKIM
certification. This domain should match the domain in the From address
of your email.</p>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<th>Parameter Name</th>
<th>Parameter Value</th>
<th>Parameter Description</th>
</tr>
<tr>
<td>domain</td>
<td><code>domain</code></td>
<td>The domain you would like your DKIM certification signed with</td>
</tr>
<tr>
<td>use_from</td>
<td><code>0</code> | <code>1</code></td>
<td>If enabled, the domain in the From: header of the email will be used to sign your DKIM</td>
</tr>
</tbody>
</table>
<h4>Example X-SMTPAPI Header Value</h4>
{% codeblock lang:json %}
{
"filters" : {
"dkim" : {
"settings" : {
"domain" : "example.com",
"use_from" : false
}
}
}
}
{% endcodeblock %}
<hr/>
{% anchor h3 footer %}
Filter: <code>footer</code>
{% endanchor %}
<p>Inserts a footer at the bottom of the text and HTML bodies.</p>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<th>Parameter Name</th>
<th>Parameter Value</th>
<th>Parameter Description</th>
</tr>
<tr>
<td>enable</td>
<td><code>0</code> | <code>1</code></td>
<td>Disable or enable this Setting</td>
</tr>
<tr>
<td>text/html</td>
<td><code>string</code></td>
<td>String containing html body</td>
</tr>
<tr>
<td>text/plain</td>
<td><code>string</code></td>
<td>String containing text body</td>
</tr>
</tbody>
</table>
<h4>Example X-SMTPAPI Header Value</h4>
{% codeblock lang:json %}
{
"filters" : {
"footer" : {
"settings" : {
"enable" : 1,
"text/html" : "<p>Thanks,<br />The SendGrid Team<p>",
"text/plain" : "Thanks,\n The SendGrid Team"
}
}
}
}
{% endcodeblock %}
<hr/>
{% anchor h3 ganalytics %}
Filter: <code>ganalytics</code>
{% endanchor %}
<p>Re-writes links to integrate with Google Analytics.</p>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<th>Parameter Name</th>
<th>Parameter Value</th>
<th>Parameter Description</th>
</tr>
<tr>
<td>enable</td>
<td><code>0</code> | <code>1</code></td>
<td>Disable or enable this Setting</td>
</tr>
<tr>
<td>utm_source</td>
<td><code>string</code></td>
<td>Value for the utm_source field</td>
</tr>
<tr>
<td>utm_medium</td>
<td><code>string</code></td>
<td>Value for the utm_medium field</td>
</tr>
<tr>
<td>utm_term</td>
<td><code>string</code></td>
<td>Value for the utm_term field</td>
</tr>
<tr>
<td>utm_content</td>
<td><code>string</code></td>
<td>Value for the utm_content field</td>
</tr>
<tr>
<td>utm_campaign</td>
<td><code>string</code></td>
<td>Value for the utm_campaign field</td>
</tr>
</tbody>
</table>
<h4>Example X-SMTPAPI Header Value</h4>
{% codeblock lang:json %}
{
"filters" : {
"ganalytics" : {
"settings" : {
"enable" : 1,
"utm_source" : "Transactional Email",
"utm_medium" : "email",
"utm_content" : "Reset Your Password",
"utm_campaign" : "Redesigned Transactional Messaging"
}
}
}
}
{% endcodeblock %}
<hr/>
{% anchor h3 opentrack %}
Filter: <code>opentrack</code>
{% endanchor %}
<p>If you don't use 'replace' this will insert an <code><img></code> tag at the bottom of the html section of an email which will be used to track if an email is opened. If you choose to use 'replace', you can put the tracking pixel wherever you would like in the email and SendGrid will replace it at send time.</p>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<th>Parameter Name</th>
<th>Parameter Value</th>
<th>Parameter Description</th>
</tr>
<tr>
<td>enable</td>
<td><code>0</code> | <code>1</code></td>
<td>Disable or enable this Setting</td>
</tr>
<tr>
<td>replace</td>
<td>string</td>
<td>A string to be replaced by SendGrid with the tracking image at send time.</td>
</tr>
</tbody>
</table>
<h4>Example X-SMTPAPI Header Value</h4>
{% codeblock lang:json %}
{
"filters" : {
"opentrack" : {
"settings" : {
"enable" : 1,
"replace" : "%opentrack%"
}
}
}
}
{% endcodeblock %}
<hr/>
{% anchor h3 spamcheck %}
Filter: <code>spamcheck</code>
{% endanchor %}
<p>Tests message with <a href="http://spamassassin.apache.org/">SpamAssassin</a> to determine if it is spam, and drop it if it is.</p>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<th>Parameter Name</th>
<th>Parameter Value</th>
<th>Parameter Description</th>
</tr>
<tr>
<td>enable</td>
<td><code>0</code> | <code>1</code></td>
<td>Disable or enable this Setting</td>
</tr>
<tr>
<td>maxscore</td>
<td><code>1</code> to <code>10.0</code></td>
<td>Score after which the message will be dropped (default is 5.0, higher scores indicate higher likelihood of spam)</td>
</tr>
<tr>
<td>url</td>
<td><code>url</code></td>
<td>an optional url to POST the email and a copy of the report to. Refer to the <a href="{{root_url}}/User_Guide/Settings/mail.html#-Spam-Checker">Spam Checker documentation</a> for POST details.</td>
</tr>
</tbody>
</table>
<h4>Example X-SMTPAPI Header Value</h4>
{% codeblock lang:json %}
{
"filters" : {
"spamcheck" : {
"settings" : {
"enable" : 1,
"maxscore" : 3.5,
"url" : "http://example.com/compliance"
}
}
}
}
{% endcodeblock %}
<hr/>
{% anchor h3 subscriptiontrack %}
Filter: <code>subscriptiontrack</code>
{% endanchor %}
<p>Inserts a subscription management link at the bottom of the text and html bodies or insert the link anywhere in the email.</p>
<p>If you wish to append an unsubscription link, use the <code>text/html</code> and <code>text/plain</code> parameters. However, if you wish to have the link replace a tag (such as <code>[unsubscribe]</code>), use the <code>replace</code> parameter.</p>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<th>Parameter Name</th>
<th>Parameter Value</th>
<th>Parameter Description</th>
</tr>
<tr>
<td>enable</td>
<td><code>0</code> | <code>1</code></td>
<td>Disable or enable this App</td>
</tr>
<tr>
<td>text/html</td>
<td><code>string</code></td>
<td>HTML to be appended to the email, with the subscription tracking link. You may control where the link is by using a tag like so: <code><% link text %></code></td>
</tr>
<tr>
<td>text/plain</td>
<td><code>string</code></td>
<td>Text to be appended to the email, with the subscription tracking link. You may control where the link is by using a tag like so: <code><% %></code></td>
</tr>
<tr>
<td>replace</td>
<td><code>string</code></td>
<td>A tag that will be replaced with the unsubscribe URL (e.g. <code>[unsubscribe_url]</code>). If this parameter is included, it will override <code>text/html</code> and <code>text/plain</code> The URL of the link will be placed at the replace tag's location, with no html or other formatting.</td>
</tr>
</tbody>
</table>
{% warning %}
The <code>landing</code> argument cannot be used in SMTPAPI. It can only be setup via the UI or WebAPI, as an account-level setting.
{% endwarning %}
<h4>Example X-SMTPAPI Header Value</h4>
{% codeblock lang:json %}
{
"filters": {
"subscriptiontrack": {
"settings": {
"text/html": "If you would like to unsubscribe and stop receiving these emails <% click here %>.",
"text/plain": "If you would like to unsubscribe and stop receiving these emails click here: <% %>.",
"enable": 1
}
}
}
}
{% endcodeblock %}
<hr/>
{% anchor h3 templates %}
Filter: <code>templates</code>
{% endanchor %}
{% info %}
This setting refers to SendGrid's <a href="{{root_url}}/API_Reference/Web_API_v3/Transactional_Templates/index.html">transactional templates</a>. SendGrid supports versioning, and the ability to create multiple transactional templates. Previously, we had a Template App, which is now referred to as the <a href="#template">Legacy Template App</a>.
{% endinfo %}
<p>Uses a <a href="{{root_url}}/API_Reference/Web_API_v3/Transactional_Templates/index.html">transactional template</a> when sending an email.
<table class="table table-striped table-bordered">
<tbody>
<tr>
<th>Parameter Name</th>
<th>Parameter Value</th>
<th>Parameter Description</th>
</tr>
<tr>
<td>enable</td>
<td><code>0</code> | <code>1</code></td>
<td>Disable or enable this Setting</td>
</tr>
<tr>
<td>template_id</td>
<td><code>string</code></td>
<td>The ID of the template to use when sending a message, represented by a string.</td>
</tr>
</tbody>
</table>
<h4>Example X-SMTPAPI Header Value</h4>
{% codeblock lang:json %}
{
"filters": {
"templates": {
"settings": {
"enable": 1,
"template_id": "5997fcf6-2b9f-484d-acd5-7e9a99f0dc1f"
}
}
}
}
{% endcodeblock %}
<hr/>
{% anchor h3 template %}
Filter: <code>template</code>
{% endanchor %}
{% warning %}
This setting refers to our original Email Template app. We now support more fully featured <a href="#templates">transactional templates</a>. You may create multiple transactional templates that allow for versioning, in addition to several other features.
{% endwarning %}
<p>Wraps a template around your email content. Useful for sending out marketing email and other nicely formatted messages.</p>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<th>Parameter Name</th>
<th>Parameter Value</th>
<th>Parameter Description</th>
</tr>
<tr>
<td>enable</td>
<td><code>0</code> | <code>1</code></td>
<td>Disable or enable this Setting</td>
</tr>
<tr>
<td>text/html</td>
<td><code>string</code></td>
<td>String containing html content for the template (must contain a <code><% body %></code> tag)</td>
</tr>
</tbody>
</table>
<h4>Example X-SMTPAPI Header Value</h4>
{% codeblock lang:json %}
{
"filters" : {
"template" : {
"settings" : {
"enable" : 1,
"text/html" : "<html><head></head><body bgcolor='pink'><div style='width:200px' bgcolor='#FFF'><% body %></div></body></html>"
}
}
}
}
{% endcodeblock %}
<hr/>