forked from elioqoshi/phplist-manual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ch017_using-placeholders.xhtml
98 lines (98 loc) · 5.04 KB
/
ch017_using-placeholders.xhtml
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title/></head><body><h1>Using placeholders
</h1>
<p>A place holder is a word in square brackets, for example,
</p>
<p> [FIRSTNAME]
</p>
<p>or
</p>
<p>[UNSUBSCRIBE] 
</p>
<p>which will be replaced with real data, such as the subscriber's name or a unique URL during sending.
</p>
<h2>Placeholders in phpList
<br/></h2>
<p>There are three types of placeholder in phpList:
</p>
<ul><li> System e.g. [UNSUBSCRIBE]</li>
<li>Config e.g. [WEBSITE]</li>
<li>Attribute e.g. [FIRSTNAME]</li>
</ul><p>In this chapter we will deal with the Attribute placeholders only. We will deal with system and config placeholders in the templating and configuration chapters respectively.
</p>
<h2>Where to find a list of Attribute placeholders
</h2>
<p>When composing a campaign, you can find a list of placeholders by clicking on the information symbol, <strong>i</strong>, next to the text <strong>Compose Message</strong>.
</p>
<p><img src="static/where_to_find_placeholders_list_phpList_2.png" alt="how to find a list of placeholders in phpList" height="314" width="423"/> 
</p>
<p>Any <strong>Attribute</strong> placeholders will be listed here along with instructions on how to use them.
</p>
<p><img src="static/where_to_find_placeholders_list_phpList.png" alt="list of placeholders and attributes on compose tab " height="313" width="600"/></p>
<p>These are generated directly from your chosen Attributes so if you wish to edit them, please see the Attributes chapter. 
</p>
<h2>How to use a placeholder in a mail 
</h2>
<p>To use a placeholder, you need to type it exactly as suggested in the information,<strong> i</strong>, box. This will include:
</p>
<p>
</p>
<ul><li>an open square bracket</li>
<li>the placeholder name (in Capitals, with spaces) </li>
<li>and a close square bracket</li>
</ul><p>
</p>
<p>It is also wise to use some <strong>fallback words</strong>, that is words that will be inserted in place of the data when the data is missing. You can indicate the <em>fallback words</em> with the double percent sign <strong>%%</strong>. Anything before the %% is the attribute placeholder. Everything after the %% is the fallback text. The fallback text is optional.
<br/></p>
<p>In this example, the placeholder would either print the subscribers' <strong>first name</strong>, and where the name is not known, it will print the word <strong>Friends</strong>.
</p>
<p><img src="static/how_to_use_placeholders_1.png" alt=""/></p>
<p> 
</p>
<p/>
<p> It is important that you test your placeholder before you send your mail, as mistakes are ugly and disconcerting for your subscribers.
</p>
<h3>Set up two test accounts
</h3>
<p>To test your placeholder effectively you will need:
</p>
<p>
</p>
<ul><li>one subscriber profile suitable for testing the attribute placeholder. You can use an alternative email to which you have access, where the attribute data is completed</li>
<li>another subscriber using an email you have access to, where the attribute data is not completed.</li>
</ul><p>
</p>
<p>You may need to add these emails or edit your existing data to achieve this. You can do all these things from the <strong>Search</strong> > <strong>Search Subscribers</strong> page.
</p>
<p>In the example below I have subscribed myself to the system using my personal email (rather than my work email) and I have filled out my name.
</p>
<p><img src="static/testing_name_known.png" alt="subscriber profile with attribute data" height="199" width="671"/></p>
<p>And I have another one using my old email address where the attribute data has not been provided.
</p>
<p><img src="static/testing_name_not_known.png" alt="subscriber profile with not attribute data" height="196" width="663"/></p>
<p>
</p>
<p><span>Send a test message</span>
</p>
<p>Next, enter the two test emails into the <strong>Send Test </strong>box at the bottom of your campaign <strong>Content </strong>page and press <strong>Send Test.</strong> You may need to confirm the emails if it is the first time you have used them.
</p>
<h3>Check the results
</h3>
<p>For the subscriber where the attribute related to the placeholder has data, you should see that data in the email. In this example you can see the name Anna is visible in the place of [FIRST NAME]
</p>
<p><img src="static/testing_name_known_outcome_1.png" alt="attribute working" height="421" width="600"/> 
</p>
<p>Where the subscriber has no data for the attribute, you should see the <strong>Fallback Text</strong>. In this example that is the word <strong>Friends</strong>.
</p>
<p><img src="static/testing_name_not_known_outcome.png" alt="fallback text working in place of attribute" height="408" width="584"/> 
</p>
<p>You can now send your campaign as usual.
</p>
<h2>Feedback
<br/></h2>
<p>Discuss this chapter <a href="https://discuss.phplist.org/t/using-placeholders-manual-chapter-feedback-and-discussion/210">here</a>.
<br/></p>
<p>
</p></body></html>