View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
18345Bug reportsExpression Managerpublic2022-09-19 11:03
ReporterMazi Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version5.3.x 
Summary18345: Missing email placeholder for "Reminder count"
Description

There are many placeholders you can use at your email templates but an option to include the number of reminders sent is missing. Thing is that sometimes you want to add a note like "We had already reminded you XXX times to take the survey...".
Another use case is having slightly different email texts for the first reminder and a second, final reminder. That would also be doable using EM when being able to access the reminder count variable.

Since other variables are available, I consider this a bug, not a missing feature ;-)

Steps To Reproduce

Steps to reproduce

Try adding a placeholder like {REMINDERCOUNT} to yur email templates.

Expected result

Show the reminder count value.

Actual result

Nothing happens since this placeholder is currently missing.

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)5.3
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMariaDB 10.1.48
Server OS (if known)
Webserver software & version (if known)
PHP Version8.1.6

Relationships

related to 18351 closedadamzammit Extra token placeholder show as invalid in expression 

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2022-09-12 20:02

developer   ~71685

Last edited: 2022-09-12 20:03

Can you test with {TOKEN:REMINDERCOUNT} ? It work inside survey (but shown as error).

like {TOKEN:SENT} or {TOKEN:REMINDERSENT}

Mazi

Mazi

2022-09-12 23:49

updater   ~71693

@DenisChenu: Thanks a lot for the very helpful input!
The placeholder indeed works, the correct number gets added. But the "ExpressionScript" check shows it as unknow variable.

image.png (21,514 bytes)   
image.png (21,514 bytes)   
Mazi

Mazi

2022-09-12 23:51

updater   ~71694

Also the manual seems to be outdated. Can someone check the source code which placeholders are actually supported but not yet listed at https://manual.limesurvey.org/Email_templates#Email_Placeholders?

DenisChenu

DenisChenu

2022-09-13 09:08

developer   ~71695

The placeholder indeed works, the correct number gets added. But the "ExpressionScript" check shows it as unknow variable.

Yes , i have to report this issue since month now …

Can someone check the source code which placeholders are actually supported but not yet listed

All database column are supported currently, except PARTICPANTID because Expression disable usage of in attribute (except for attribute_X)

Mazi

Mazi

2022-09-13 09:52

updater   ~71697

@DeniChenu, where can we see the exact syntax for every placeholder? I could then update the manual.

DenisChenu

DenisChenu

2022-09-13 10:04

developer   ~71698

https://github.com/LimeSurvey/LimeSurvey/blob/32f7bc2a95961227846058c0b0cd3c4e4342b23c/application/core/LimeMailer.php#L807

foreach ($this->oToken->attributes as $attribute => $value) {
                $aTokenReplacements[strtoupper($attribute)] = $value;
            }

https://github.com/LimeSurvey/LimeSurvey/blob/32f7bc2a95961227846058c0b0cd3c4e4342b23c/application/models/Token.php#L6

PS : looking at code : seems {REMINDERCOUNT} can work but shown as red ? Can you test ?

Mazi

Mazi

2022-09-13 10:35

updater   ~71699

@DeniChenu, yes, REMINDERCOUNT also works fine but is marked red as well.

Does that mean we can simply use the column name in capital letters for every column but TID?

DenisChenu

DenisChenu

2022-09-13 12:00

developer   ~71701

Does that mean we can simply use the column name in capital letters for every column but TID?

Yes
{TID} too

the only exception in participant_id because the underscore.
https://github.com/LimeSurvey/LimeSurvey/blob/32f7bc2a95961227846058c0b0cd3c4e4342b23c/application/models/Token.php#L38

{MPID} too (never updated by LS)

Mazi

Mazi

2022-09-14 12:49

updater   ~71725

Placeholder list updated at https://manual.limesurvey.org/Email_templates#Email_Placeholders

DenisChenu

DenisChenu

2022-09-14 15:35

developer   ~71753

Thank you !

Why you don't add MPID ?

I add " in ISO8601 format with time (Y-m-d H:i:s in PHP)" for the 2 dates ;)

DenisChenu

DenisChenu

2022-09-14 15:52

developer   ~71755

I can not assign it to you ?
Why ?

I create the RED alert issue https://bugs.limesurvey.org/view.php?id=18351
More clear

Issue History

Date Modified Username Field Change
2022-09-12 19:52 Mazi New Issue
2022-09-12 20:02 DenisChenu Note Added: 71685
2022-09-12 20:02 DenisChenu Bug heat 0 => 2
2022-09-12 20:03 DenisChenu Note Edited: 71685
2022-09-12 23:49 Mazi Note Added: 71693
2022-09-12 23:49 Mazi File Added: image.png
2022-09-12 23:49 Mazi Bug heat 2 => 4
2022-09-12 23:51 Mazi Note Added: 71694
2022-09-13 09:08 DenisChenu Note Added: 71695
2022-09-13 09:52 Mazi Note Added: 71697
2022-09-13 10:04 DenisChenu Note Added: 71698
2022-09-13 10:04 DenisChenu Assigned To => DenisChenu
2022-09-13 10:04 DenisChenu Status new => assigned
2022-09-13 10:35 Mazi Note Added: 71699
2022-09-13 12:00 DenisChenu Note Added: 71701
2022-09-14 12:49 Mazi Note Added: 71725
2022-09-14 15:35 DenisChenu Note Added: 71753
2022-09-14 15:51 DenisChenu Relationship added related to 18351
2022-09-14 15:52 DenisChenu Assigned To DenisChenu =>
2022-09-14 15:52 DenisChenu Status assigned => resolved
2022-09-14 15:52 DenisChenu Resolution open => fixed
2022-09-14 15:52 DenisChenu Note Added: 71755
2022-09-19 11:03 DenisChenu Assigned To => DenisChenu
2022-09-19 11:03 DenisChenu Status resolved => closed