Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

endurl TOKEN not working

  • teracomp
  • teracomp's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago #191856 by teracomp
endurl TOKEN not working was created by teracomp
I have several cases where {TOKEN} is not being passed to the endurl for a survey. Here's the endurl:
Code:
https://mywebsite.com/rpt.php?token={TOKEN}&code={code}

Email template, basic admin notification:
Code:
Hello,
A new response was submitted for your survey '{SURVEYNAME}'.
Link to report: https://mywebsite.com/rpt.php?token={TOKEN}&code={code}
Possibly token: {TOKEN: TOKEN}
 
Click the following link to see the individual response:
{VIEWRESPONSEURL}

And the email generated to me:
Code:
A new response was submitted for your survey 'Church Life Cycle'.
Link to report: https://mywebsite/rpt.php?token=&code=clc11
Possibly token:
 
Click the following link to see the individual response:
https://mywebsite.com/app/s/index.php/admin/responses/sa/view/surveyid/178587/id/256


This means the endurl for the user was:
Code:
https://mywebsite/rpt.php?token=&code=clc11

My rpt.php file requires the token parameter, as you might expect. When it's empty, rpt.php redirects the participant to an error form to notify me of the issue.

Now I know why some have been complaining.

The extremely odd thing about this issue is I use the same pattern on several surveys (about 20). The {TOKEN} has not failed before.

Looking at the individual response from {VIEWRESPONSEURL}, [token] appears twice:
  • [token] Token ID TW1912081575783506HhqYjq
  • [submitdate] Submission date 12-07-2019 16:48:33
  • Completed Y
  • [id] Response ID 256
  • [startlanguage] Start language en
  • [seed] Seed 902380868
  • [token] Token TW1912081575783506HhqYjq

I took the survey myself to see what the confirmation email rendered. Here's some good news. The confirmation email includes the correct link. Here's the line in the email template:
Code:
You can view your individual results here: https://mywebsite.com/rpt.php?token={TOKEN}&code={code}
And here's how the email looks:
Code:
You can view your individual results here: https://mywebsite.com/rpt.php?token=TW1912081575803450LqkPuR&code=demo

However, as before, the endurl was not correctly rendered. The {TOKEN} is not inserted, even though it's obviously there in the confirmation email.

Any thoughts for my next round of debugging?

Many thanks.

Dave Phillips
The topic has been locked.
  • teracomp
  • teracomp's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago #191911 by teracomp
Replied by teracomp on topic endurl TOKEN not working
Here's some additional information. I added code to the rpt.php file to send me an email to help track the issue.

The endurl is processed from the survey and points to my website's rpt.php script. I'm checking for and trapping the querystring params at the top of my rpt.php script. Here's what I get (for example):
Code:
New CLC report requested with token TW1912091575912165TSqTLM and code clc18

At the same time, this is what I get from the Basic Admin notice email:
Code:
A new response was submitted for your survey 'Church Life Cycle'.
Link: https://truewiring.com/app/clc/rpt.php?token=&code=clc18

Notice that token= nothing. No token is shown.

Based on the email from my rpt.php script, it appears that the token is being processed. The confusing part is I don't see the token in my Admin notice. In other words, it appears that {TOKEN} is working, but for some reason, it doesn't show up in the Basic Admin notification and probably doesn't show up on the confirmation email.

Very odd.

Any thoughts?

Dave Phillips
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago - 4 years 4 months ago #191918 by tpartner
Replied by tpartner on topic endurl TOKEN not working
Did you try {TOKEN:TOKEN} (with no spaces)?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 4 months ago by tpartner.
The following user(s) said Thank You: teracomp
The topic has been locked.
  • teracomp
  • teracomp's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago #191920 by teracomp
Replied by teracomp on topic endurl TOKEN not working
Ah...no spaces...I missed that. That's the secret for email templates.
For what it's worth, the endurl still only has {TOKEN} and appears to be working.
Does it make sense to change all my endurl strings to {TOKEN:TOKEN}??

Dave Phillips
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #191922 by tpartner
Replied by tpartner on topic endurl TOKEN not working
As far as I know, {TOKEN:TOKEN} works everywhere but please test and let us know.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • teracomp
  • teracomp's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago #191941 by teracomp
Replied by teracomp on topic endurl TOKEN not working
Thanks, Tony. I will certainly test and report back.

Dave Phillips
The topic has been locked.
  • teracomp
  • teracomp's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago #191966 by teracomp
Replied by teracomp on topic endurl TOKEN not working
Using {TOKEN:TOKEN} as a parameter for the endurl definitely works. All of my other surveys just use {TOKEN} and I have not seen an issue.

Dave Phillips
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose