Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Formatted expiration date in invitation/reminder emails?

Formatted expiration date in invitation/reminder emails? 2 years 6 months ago #105433

  • rmenezes
  • rmenezes's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
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.
The administrator has disabled public write access.

Formatted expiration date in invitation/reminder emails? 2 years 6 months ago #105448

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6230
  • Thank you received: 1382
  • Karma: 539
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:
{date('j \d\e F', strtotime(EXPIRY))}


.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 2 years 6 months ago by tpartner.
The administrator has disabled public write access.
The following user(s) said Thank You: rmenezes

Formatted expiration date in invitation/reminder emails? 2 years 6 months ago #105510

  • rmenezes
  • rmenezes's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
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:
{date('j \d\e F', strtotime(EXPIRY))}


.

All right. Let the old swatter have some action then. Thanks for the character escaping hint.

Peace.
The administrator has disabled public write access.

Formatted expiration date in invitation/reminder emails? 7 months 5 days ago #130329

  • saltheart
  • saltheart's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
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?
The administrator has disabled public write access.

Formatted expiration date in invitation/reminder emails? 7 months 4 days ago #130375

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6230
  • Thank you received: 1382
  • Karma: 539
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.)
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.609 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form