back to phpList.org

Using placeholders: manual chapter feedback and discussion


#1

Feedback on the following chapter: https://www.phplist.org/manual/ch017_using-placeholders.xhtml


#2

If you have related fields, for instance [NAME], [FIRSTNAME], [LASTNAME] but not all fields are necessarily filled out, you can use placeholders nested, as fallback words. For instance:

Hi [FIRSTNAME%%[NAME%%there]],

In this example [FIRSTNAME] is used, but if that field is empty, [NAME] will be used, unless [NAME] is empty as well, in which case ‘there’ will be used.


#3

You could consider merging the attributes FIRSTNAME and NAME however


#4

In my case I have a field [NAME] that contains the full name of a person (it is the only field required to sign up for a newsletter (aside from the email address). The [FIRSTNAME] field is empty for those people.

I have another list where, during import, I also populated [FIRSTNAME].

When I send an email to both lists (or some users may be on the two lists), I want to address them with their first name, and if not present with their full name. Hence that syntax and use.


#5

So

Hi Bob
or

Hi Bob Smith

or Hi there

could be the results?


#6

Fab! I am trying to think of other uses so we can give more examples.

I am not great at constructing them

What if we wanted to do something like

“Sale on ladies size 7 shoes” as an example filled in
"Sale on your size of shoe" as the fallback with
or “sale on ladies shoes”

Something like Sale on [[GENDER][SHOESIZE]%%your size of]shoes ?


#7

Exactly !

I think that is not correct, nesting is not needed here, following should do however:

Sale on [GENDER] [SHOESIZE%%your size] shoes

If [GENDER] is empty, nothing is put (provided the bug in 3.0.12 is fixed)
If [SHOESIZE] is empty ‘your size’ is used


#8

True :slight_smile: Can you think of another example where nesting is needed? Or perhaps we can make a generic formula [x%%[y]] or something?


#9

Frankly, no !?
It is only useful for related fields, where the most optimum may be empty but then the other will do too.


#10

Perfect explanation!!


#11

Ref: Page 131 of the pdf manual. (bottom)

[FORWARD]

[FORWARD] is a link where the recipient can go to “forward this
message”. The default text for this placeholder is this link.

For example, if you use “If you want to forward this message to a
friend click [FORWARD]”, it will come out as:
---------- something seems to be missing in here -----------
[UNSUBSCRIBE]

I’m a neophyte at this, so I hope I’m close to the right area for these observations.

On this page: https://www.phplist.org/manual/ch017_using-placeholders.xhtml
. . . is this error: DONWLOAD THIS MANUAL


#12

@samtuke Not sure who else to tell Sam, the download link is at the very top right of the page.


#13

Thanks @dragonrider, the link should lead to this page, where various formats of the manual can be downloaded:

Which bit isn’t working?


#14

@samtuke It works, but the text for the link is mis-spelt. DONWLOAD rather than DOWNLOAD


#15

Good catch, now fixed. Thanks!


#16

Thanks @samtuke but was spotted by @perry in first instance. Thanks go to @perry for that and for letting us know. Many thanks.


#17

Thanks @perry! Much appreciated