- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Formatted expiration date in invitation/reminder emails?
- rmenezes
- Topic Author
- Offline
- New Member
Less
More
10 years 2 months ago #105433
by rmenezes
Formatted expiration date in invitation/reminder emails? was created by rmenezes
Greetings.
I'd like to send invitation/reminder emails with the surveys expiration date. If I use the {EXPIRY} placeholder it works - but it displays a plain date string (e.g. '2014-03-31 00:00:00'). Not too friendly. I tried to EM-ify it by using something like:
{date('j de F',time(strtotime(EXPIRY)))}
But it didn't work. Any ideas? TIA.
Peace.
I'd like to send invitation/reminder emails with the surveys expiration date. If I use the {EXPIRY} placeholder it works - but it displays a plain date string (e.g. '2014-03-31 00:00:00'). Not too friendly. I tried to EM-ify it by using something like:
{date('j de F',time(strtotime(EXPIRY)))}
But it didn't work. Any ideas? TIA.
Peace.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10115
- Thank you received: 3597
10 years 2 months ago - 10 years 2 months ago #105448
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Formatted expiration date in invitation/reminder emails?
Well, it seems you've found a bug. The date() function works in questions but not in email templates. I've submitted a report -
bugs.limesurvey.org/view.php?id=8752
.
Additionally, you will need to escape a couple of characters in your expression as they are date formats:
.
Additionally, you will need to escape a couple of characters in your expression as they are date formats:
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 10 years 2 months ago by tpartner.
The following user(s) said Thank You: rmenezes
The topic has been locked.
- rmenezes
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
10 years 2 months ago #105510
by rmenezes
All right. Let the old swatter have some action then. Thanks for the character escaping hint.
Peace.
Replied by rmenezes on topic Formatted expiration date in invitation/reminder emails?
tpartner wrote: Well, it seems you've found a bug. The date() function works in questions but not in email templates. I've submitted a report - bugs.limesurvey.org/view.php?id=8752 .
Additionally, you will need to escape a couple of characters in your expression as they are date formats:
.
All right. Let the old swatter have some action then. Thanks for the character escaping hint.
Peace.
The topic has been locked.
- saltheart
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
8 years 3 months ago #130329
by saltheart
Replied by saltheart on topic Formatted expiration date in invitation/reminder emails?
I tried following your advice to include a formatted EXPIRY date in the Reminder email template. This works:
{date('l\, F j\, Y',strtotime('2016-01-28'))}
But this does NOT work:
{date('l\, F j\, Y',strtotime(EXPIRY))}
In fact, I can't even get this to work: {strtotime(EXPIRY)}, although if I "Validate expression in Reminder" it is able to show me the value of EXPIRY. Is there something else I must do to get it to evaluate EXPIRY in the expression?
{date('l\, F j\, Y',strtotime('2016-01-28'))}
But this does NOT work:
{date('l\, F j\, Y',strtotime(EXPIRY))}
In fact, I can't even get this to work: {strtotime(EXPIRY)}, although if I "Validate expression in Reminder" it is able to show me the value of EXPIRY. Is there something else I must do to get it to evaluate EXPIRY in the expression?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10115
- Thank you received: 3597
8 years 3 months ago #130375
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Formatted expiration date in invitation/reminder emails?
I have tested {date('l\, F j\, Y',strtotime(EXPIRY))} in reminder emails in latest version of LimeSurvey 2.06 - it works fine.
(Please do not cross-post - you aren't going to get any better answers.)
(Please do not cross-post - you aren't going to get any better answers.)
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.