Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
08752Feature requestsExpression Managerpublic2015-01-02 19:37
Reportertpartner Assigned ToDenisChenu  
PrioritynormalSeverityfeature 
Status closedResolutionno change required 
Summary08752: Expression manager date() function does not work in email templates
Description

The expression manager date() function works in questions but not in email templates.

Steps To Reproduce

Insert the following expression in a question and in an email template:

{date("l jS \of F Y h:i:s A")}

See the invitation email in the attached survey.

TagsNo tags attached.
Attached Files
Bug heat8
Story point estimate
Users affected %

Relationships

related to 09424 closedLouisGac Bug reports Expression Manager in mail sending use "Actual response" 

Activities

c_schmitz

c_schmitz

2014-02-24 14:44

administrator   ~28885

Nobody said this would work in invitations. EM is used in the context of a survey runtime where the invitation is not - so it is more like a missing feature.

tpartner

tpartner

2014-02-24 14:59

partner   ~28889

Okay, but it seems a bit odd that we can use EM variables but not functions.

For example, this works in email templates:

{q1.question}

c_schmitz

c_schmitz

2014-02-24 15:02

administrator   ~28890

I agree that's weird ?

DenisChenu

DenisChenu

2014-02-24 16:45

developer   ~28896

Last edited: 2014-02-24 16:52

Something i don't understand , we use templatereplace in Email ?

Because we use LimeExpressionManager::ProcessString in templatereplace, i allways think processtring allow EM function.

Maybe more the $bStaticReplacement param of templatereplace ?


EDIT : we use Replacefields and not templatereplace, then : can not use EM function.

mfaber

mfaber

2014-02-24 17:34

reporter   ~28898

Weird indeed. In the manual (http://manual.limesurvey.org/Tokens#Email_placeholders) it says:
Starting in Version 1.92, you can use Expression Manager to use expressions for tailoring an email. Please have a look at the Expression Manager HowTos for an example.

On another page (http://manual.limesurvey.org/Email_templates) it says:

"All functions supported by the Expression Manager can be used, as well as token attributes if the survey uses tokens.

In case of a notification or confirmation template it is also possible to use question codes used in the survey."

I am not sure if the latter pertains to attachments (the manual is not really clear to me...)

DenisChenu

DenisChenu

2014-02-24 18:31

developer   ~28899

And {join(ATTRIBUTE_1,ATTRIBUTE_14)} work good.
(Replacefields use LimeExpressionManager::ProcessString)

Maybe something with date format ?

mfaber

mfaber

2014-02-24 20:50

reporter   ~28900

{date("l jS \of F Y h:i:s A")} is a weird one but works well in php and nearly so in js...so I don't think that's the problem....

DenisChenu

DenisChenu

2014-12-26 17:17

developer   ~31349

Last edited: 2014-12-26 17:22

All seems strange ....

Invite - remind
{InvalidQuestion.shown} : broke
{Question.shown} : empty string
{TEMPLATEURL} : broke
{join(FIRSTNAME,LASTNAME)} : OK

Confirm:
{InvalidQuestion.shown} : broke
{Question.shown} : OK
{TEMPLATEURL} : OK
{join(FIRSTNAME,LASTNAME)} : OK

Think the best is to review all system ....

I think we must review all email REPLACE system

PS: date need $_SESSION['s_lang'], no ?
PS2: LimeExpressionManager::ProcessString don't use "SURVEY" system.

DenisChenu

DenisChenu

2014-12-28 18:30

developer   ~31359

Seems OK now, @Tony : can you test with the last version ?

tpartner

tpartner

2015-01-02 19:23

partner   ~31410

@Denis: Yep, works great. Thanks Denis.

Issue History

Date Modified Username Field Change
2014-02-23 15:42 tpartner New Issue
2014-02-23 15:42 tpartner File Added: limesurvey_survey_815172.lss
2014-02-24 14:41 c_schmitz Assigned To => c_schmitz
2014-02-24 14:41 c_schmitz Status new => assigned
2014-02-24 14:44 c_schmitz Note Added: 28885
2014-02-24 14:44 c_schmitz Assigned To c_schmitz =>
2014-02-24 14:44 c_schmitz Status assigned => new
2014-02-24 14:45 c_schmitz Project Bug reports => Feature requests
2014-02-24 14:59 tpartner Note Added: 28889
2014-02-24 15:02 c_schmitz Note Added: 28890
2014-02-24 16:45 DenisChenu Note Added: 28896
2014-02-24 16:45 DenisChenu Severity @50@ => feature
2014-02-24 16:52 DenisChenu Note Edited: 28896
2014-02-24 17:34 mfaber Note Added: 28898
2014-02-24 18:31 DenisChenu Note Added: 28899
2014-02-24 20:50 mfaber Note Added: 28900
2014-12-26 17:17 DenisChenu Note Added: 31349
2014-12-26 17:17 DenisChenu Note Edited: 31349
2014-12-26 17:19 DenisChenu Note Edited: 31349
2014-12-26 17:20 DenisChenu Note Edited: 31349
2014-12-26 17:20 DenisChenu Note Edited: 31349
2014-12-26 17:21 DenisChenu Note Edited: 31349
2014-12-26 17:22 DenisChenu Note Edited: 31349
2014-12-26 19:16 DenisChenu Relationship added related to 09424
2014-12-28 18:30 DenisChenu Note Added: 31359
2014-12-28 18:30 DenisChenu Assigned To => tpartner
2014-12-28 18:30 DenisChenu Status new => feedback
2015-01-02 19:23 tpartner Note Added: 31410
2015-01-02 19:23 tpartner Status feedback => assigned
2015-01-02 19:24 tpartner Assigned To tpartner => DenisChenu
2015-01-02 19:37 DenisChenu Status assigned => closed
2015-01-02 19:37 DenisChenu Resolution open => no change required
2015-01-02 19:37 DenisChenu Fixed in Version => 2.05+