Dependency Graph
View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0019148 | phpList 3 application | Interface - Administrator | public | 28-03-18 17:37 | 09-05-18 13:55 |
Reporter | Assigned To | ||||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | resolved | Resolution | fixed | ||
Platform | Linux | OS | Fedora | OS Version | 26 |
Product Version | 3.3.1 | ||||
Target Version | 3.3.3 | Fixed in Version | 3.3.3 | ||
Summary | 0019148: Add documentation on subscriber data placeholders in contextual help | ||||
Description | Edit: Issue summary was updated from: 'Add more placeholders available by default with basic subscriber info'. Reason for update is that this data is already available, just not documented. The following data is available for all subscribers but not accessible via campaign placeholders: - Entered - Last modified - Number of bounces Make this data available by default on a new phpList 3 installation via placeholders in campaigns. Preferably use descriptive placeholder names such as: - [SIGNUP DATE] - [SUBSCRIPTION LAST MODIFIED DATE] - [BOUNCES THIS SUBSCRIBER] The dates in particular are useful for re-confirmation campaigns, e.g. "Remember us? You signed up to receive newsletters on [SIGNUP DATE]", which are common practice on other platforms. | ||||
Tags | No tags attached. | ||||
|
@michiel How are new default attributes added? Please assign this to Xheni after providing guidance. |
|
I don't understand that question in this context. I thought you meant these default attributes https://resources.phplist.com/assets/start Those are added here, as plain text files: https://github.com/phpList/phplist3/tree/master/public_html/lists/admin/data |
|
I think we should avoid using spaces in placeholders. I don't think any of the existing ones have spaces. This can caused issues with regex and line wrapping, eg [SIGNUP DATE] won't match, but people will think it does. So, in general no spaces or other characters (not underscores either, they are even more confusing, as often they look like spaces, but aren't). Also dashes cause loads of trouble. I would also argue for short tags, which can be explained in the docs SIGNUPDATE BOUNCECOUNTER etc |
|
@michiel My question would have more accurately been "How are new default placeholders added?". The confusion came from placeholders stemming from attributes, and the data in question (e.g. subscription date) is stored in the system but not strictly speaking an attribute and therefore not available as a placeholder. To rephrase: what approach would you use to make data such as subscriber creation date available as a placeholder by default in campaign content? |
|
"userdata" is populated here: https://github.com/phpList/phplist3/blob/master/public_html/lists/admin/sendemaillib.php#L84 and the placeholders replaced here: https://github.com/phpList/phplist3/blob/master/public_html/lists/admin/sendemaillib.php#L449 So, even though the docs probably do not mention them, all "user" fields should work as placeholders. Try sending a campaign with [UUID] or [BOUNCECOUNT] and it will be populated. You can even use the Fallback: [BOUNCECOUNT%%no emails bounced to your address] |
|
is that enough? Basically, if you want to add placeholders, add entries to the "html", "text" or userdata associative arrays, which are automatically used for parsing. Be aware though that this section is called for every subscriber, so it needs to be fast. |
|
@michiel yes the data I was referring to is already available, just not documented in the contextual help popup which lists the others. Having tested all available phplist_user_user table columns, this is what is currently accessible via placeholders, including real data/format: ID = 6 EMAIL = sam@phplist.com CONFIRMED = 1 BLACKLISTED = 0 OPTEDIN = 0 BOUNCECOUNT = 0 ENTERED = 2017-04-07 10:34:22 MODIFIED = 2017-04-07 10:37:02 UNIQID = 42c7d9e466e98a1562722dc36574241d UUID = 096339c1-8151-406f-995f-7a9c3856821d HTMLEMAIL = 1 DISABLED = 0 It would be better if the dates were available in a more friendly format; that could either be achieved as you decribe (adding the formatted versions to the array), or (involving more work) adding support for more templating functions within placeholders (e.g. [DATE%f) for formatting dates). |
|
@michiel In order to add these placeholders to the help text for the campaign composer page, the same query that is used in sendmaillib.php could be executed in the help script (message.php), and then inserted into the array which is used to list the placeholders. That query: $query = sprintf('select * from %s where email = "%s"', $GLOBALS['tables']['user'], sql_escape($email)); Do you foresee any problems with this approach? |
|
For security reasons, we should exclude at least "password", "uuid", "id" and "uniqid" in fact, we should remove those when building campaigns. |
|
@michiel password is already not included, but "uuid", "id" and "uniqid" are. I suppose they could be useful in campaigns -- what is the security risk there? |
|
[DOMAIN] and [WEBSITE] have been tested and I confirm that they already work by default. The total list of placeholders missing from the contextual help popup on the campaign composer page is currently: [ID] [EMAIL] [CONFIRMED] [BLACKLISTED] [OPTEDIN] [BOUNCECOUNT] [ENTERED] [MODIFIED] [UNIQID] [UUID] [HTMLEMAIL] [DISABLED] [DOMAIN] [WEBSITE] |
|
Yes, except that for security I would not include UUID and ID. UNIQID is ok to include as it is sent in every email anyway. "disabled" and "optedin" are also fairly sensitive and mostly for internal use, not to be shared with the subscriber. |
|
Here is the list of placeholders to be added to the contextual help on the campaign composer page then (sensitive items have been removed): [EMAIL] [CONFIRMED] [BLACKLISTED] [BOUNCECOUNT] [ENTERED] [MODIFIED] [UNIQID] [HTMLEMAIL] [DOMAIN] [WEBSITE] The help file which handles this text is in the following repo in en/message.php: https://github.com/phpList/phplist-lan-help |
|
PR: https://github.com/phpList/phplist-lan-help/pull/16 |