-
Notifications
You must be signed in to change notification settings - Fork 2
/
Subject line checker tests.html
executable file
·104 lines (104 loc) · 6.87 KB
/
Subject line checker tests.html
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
<!-- page=Subject line checker tests -->
<!-- uid=0247986580f4479251a34780b67b4a219bef6d42 -->
<!-- time=1318616890 -->
<!-- ip=204.9.220.42 -->
<!-- content-type=text/html -->
<!-- name=Matthew Brindley -->
<!-- email=matthew@litmusapp.com -->
<h2>Introduction</h2>
<p>The subject line checker is very simple to use within your own application. First add a reference to our javascript, then simply call the method generateSubjectLineUrl for each type of result you want.</p>
<p> </p>
<h2>Adding the Litmus javascript</h2>
<p>First, add the following to the HEAD of each page you'd like to use the subject line checker in:</p>
<p> </p>
<pre><script src="http://media.emailtests.com/litmus-subject.js"></script> </pre>
<p> </p>
<p>If you prefer to use SSL:</p>
<p> </p>
<pre><script src="https://s3.amazonaws.com/media.emailtests.com/litmus-subject.js"></script></pre>
<p> </p>
<h2>Using the Litmus javascript</h2>
<p>Next, simple call the javascript function generateSubjectLineUrl:</p>
<p> </p>
<pre>function generateSubjectLineUrl(client, previewType, subject, plainBody, htmlBody, fromName)</pre>
<p> </p>
<table style="width:100%;" border="0"><tbody><tr><td><strong>Parameter name</strong> </td>
<td><strong>Description</strong> </td>
<td><strong>Example value </strong></td>
</tr><tr><td>client </td>
<td>One of a set number of clients available to test on. See the clients and types table below. </td>
<td>"ol2003" </td>
</tr><tr><td>previewType </td>
<td>Either "subject" or "toast". "subject" is the subject line preview, "toast" is the little preview window that appears when a new email arrives in some email clients. </td>
<td>"subject" </td>
</tr><tr><td>subject </td>
<td>The subject of the email to be tested. </td>
<td>"October 2011 Newsletter" </td>
</tr><tr><td>plainBody </td>
<td>The plain text version of the email's body.</td>
<td>
<p>"======</p>
<p>Welcome to ..." </p>
</td>
</tr><tr><td>htmlBody </td>
<td>The HTML version of the email's body. </td>
<td>"<h1>Welcome to...</h1>" </td>
</tr><tr><td>fromName </td>
<td>The sender's name, not email address. For example: "Paul Farnell", not "paul@litmus.com" or "Paul Farnell <paul@litmus.com>". </td>
<td>"Paul Farnell" </td>
</tr></tbody></table><p> </p>
<p>The following clients and types are available to use. This list may change/expand in the future.</p>
<p> </p>
<table style="width:100%;" border="0"><tbody><tr><td>Description </td>
<td>client</td>
<td>previewTypes available</td>
</tr><tr><td>Outlook 2003</td>
<td>ol2003 </td>
<td>toast, subject </td>
</tr><tr><td>Outlook 2007 </td>
<td>ol2007 </td>
<td>toast, subject </td>
</tr><tr><td>Outlook 2010 </td>
<td>ol2010 </td>
<td>toast, subject </td>
</tr><tr><td>Hotmail </td>
<td>hotmail </td>
<td>subject </td>
</tr><tr><td>Gmail </td>
<td>gmail </td>
<td>subject </td>
</tr><tr><td>Yahoo </td>
<td>yahoo </td>
<td>subject </td>
</tr><tr><td>BlackBerry </td>
<td>blackberry </td>
<td>subject </td>
</tr></tbody></table><p> </p>
<p>To use the function, create an IMG element in HTML and then assign its src attribute the result of the call to generateSubjectLineUrl:</p>
<p> </p>
<pre>document.getElementById('preview').src = generateSubjectLineUrl('ol2003', 'toast', 'This is the subject', 'This is the plain body', '<h1>This is the html body</h1>', 'Matthew Brindley');</pre>
<p> </p>
<p>This assumes we have an IMG with an id of "preview".</p>
<p> </p>
<h2>Sample code</h2>
<p>Below is a sample HTML page that will, on body load, set the src of its only image element to the generated url.</p>
<p> </p>
<pre><html></pre>
<pre> <head></pre>
<pre> <script src="http://media.emailtests.com/litmus-subject.js"></script> </pre>
<pre> <script type="text/javascript"></pre>
<pre> function bodyOnLoad(){</pre>
<pre> document.getElementById('preview').src = generateSubjectLineUrl('ol2003', 'toast', 'This is the subject', 'This is the plain body', '<h1>This is the html body</h1>', 'Matthew Brindley');</pre>
<pre> }</pre>
<pre> </script></pre>
<pre> </head></pre>
<pre> <body onLoad="bodyOnLoad();"></pre>
<pre> <img id="preview"/></pre>
<pre> </body></pre>
<pre></html></pre>
<p> </p>
<p>You can also <a href="http://media.emailtests.com/subject-sample-download.html">download this file</a> or <a href="http://media.emailtests.com/subject-sample.html">see a demo here</a>.</p>
<p> </p>
<p> </p>
<p> </p>
<!-- pbraw=eJzdV21v2zgM/p5fQRi4ZQUS56Vd26VpcFes2wp064B2OOyjYiuxVlkyJLlZ7nD//UjZTpzEabYC9+UKFEkoinxE8qGojM356D6ffueRAykUhyjh0SM34Lh1tpWLeNQfnpy9PT99c96fneC34ZsBOz45O+9PT8+mJ2w4eDvls9P4ZNhyIuWjwfHg/HRwev623xLZaNg/Cd+Gw2E/xPVIK8eV67plxkeO/3C9xKWypRhu+8ScS/gCroxQseTLFk+ZkKO0EP8uhUtzy7IsjHTaom3dJ2HmQo2UbnW7XXjHHIP3Wkq9sICC1jgZTm6UMzrOIye0GvdQ0Bpnk4eEg206sbDwxM0SrEgzycFpyC2HhXCJULDUuQG9UIAYpIgYmQzhvTDWAYtjYGD4jBuuIr+TtL+zJ2YjIzLXATyEKgwvIWJSkgBS7hIdv1JTm13MueKGOV7m4haBfTUSZtoAZ1ECFDPQM/Ric+kIDiyYcuG4l/lTFVaKX3jQP+JYqLn3cutDV0OzioRH3/HwSXHmo+e3aS/4eP3HO/LpAWRYKeS2HWPUHlfhcXujqUZN2DLDJ6+kuyiggDXRZZA4l416vZTHgoU+7774KNW9IvHd0kX43Qav5u6CLPQKE/5n5QCN7zic3Mx8uDKfoAr3/f3tL+GzCNAehyxlf2nFFgW4lyNuxop5+WoP5+0zUqdTlemqmtaKMMuVr3lorqq9Bz+w73UkBfK3Q6F8EnzxgDXZqbKPUsmEutLxsgNE0OLbzOj0MxL8qPnEjk3xDNYtJb8MFiJ2yWjQ7/92EcBUm5iby6Af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