Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: How can I embed {TOKEN} in a URL?

How can I embed {TOKEN} in a URL? 2 years 4 months ago #69891

  • JEfromCanada
  • JEfromCanada's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 39
  • Thank you received: 3
  • Karma: 0
When sending an invitation or reminder, the generated {SURVEYURL} is too long to fit on one line. The email program "breaks" it by splitting it onto two lines of the email.

I have a workaround...

I have created my own survey.php file to receive a {TOKEN} value and then pass it forward to the "real" survey URL.

So now, instead of:

{SURVEYURL} (which expands to mydomainname.com/surveyfolder/index.php?...&token=uadfjhtgkluah in my email program)

I use this instead:

mydomainname.com/survey.php?t={TOKEN}

and my custom survey.php generates the call to the "real" location.


Here's my problem. When I simply type the http://mydomain.... URL into the invitation email, it shows up as a string (not a clickable URL). If I use the "Link" button in the editor, the email template shows the custom URL above (with the blue underlined font indicating a link). The generated email contains the proper visual link:
mydomainname.com/survey.php?t=uadfjhtgkluah

However, when I hover over the URL, the system shows the following:

mydomainname.com/survey.php?t=<span contenteditable=


So my question is: What do I need to do to have the {TOKEN} value properly substituted into a URL?

Thank you for your assistance.


(P.S. I'm currently using build 9642 of LimeSurvey, and have another support thread active to try to find out why I am not being offered any newer versions when I try ComfortUpdate).
The administrator has disabled public write access.

Re: How can I embed {TOKEN} in a URL? 2 years 4 months ago #69906

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 5844
  • Thank you received: 715
  • Karma: 222
Hello,

Best is to deactivate the HTML editor, or use "edit source" function:

docs.limesurvey.org/Workarounds%3A+Manipulating+a+survey+at+runtime+using+Javascript&structure=English+Instructions+for+LimeSurvey#How_to_use_Script_eg._JavaScript_etc._in_LimeSurvey_
The administrator has disabled public write access.

Re: How can I embed {TOKEN} in a URL? 2 years 4 months ago #69907

  • JEfromCanada
  • JEfromCanada's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 39
  • Thank you received: 3
  • Karma: 0
Thank you, Shnoulle

I found the source of the problem. One of the PHP files (register.php) is used to do field substitution for various {EMBEDVARIABLE} symbols within the body of the mail message. There is code that builds an array of "replaceable" fields, and this array did not include a substitution value for {TOKEN}.

I added a line of code to register.php and that solved my problem.
Last Edit: 2 years 4 months ago by JEfromCanada.
The administrator has disabled public write access.

Re: How can I embed {TOKEN} in a URL? 2 years 4 months ago #69923

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 5844
  • Thank you received: 715
  • Karma: 222
JEfromCanada wrote:
Thank you, Shnoulle

I found the source of the problem. One of the PHP files (register.php) is used to do field substitution for various {EMBEDVARIABLE} symbols within the body of the mail message. There is code that builds an array of "replaceable" fields, and this array did not include a substitution value for {TOKEN}.

I added a line of code to register.php and that solved my problem.
I think you can have needing of {TOKEN} in registering process.

Maybe you can send a detailed explanation of the probelm, and maybe the patch in our bug report.
Please test if the problem still exists at the latest release. If so please open a ticket at the bugtracker and...
  1. Give as much information as possible
  2. Attach your survey. You can mark your ticket "private" so that only the developers will be able to take a look at it.
  3. Provide step-by-step instructions how to reproduce the problem.
  4. If possible/helpful please provide screenshots

Afterwards please post the link to the bugtracker so we can follow the progress.

Thanks!

:)

PS: maybe i'l totally wrong : it's the mail sending after registrated ?
The administrator has disabled public write access.

Re: How can I embed {TOKEN} in a URL? 2 years 4 months ago #70032

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
JEfromCanada wrote:
I added a line of code to register.php and that solved my problem.
Please open a ticket at the bugtracker so our develoeprs can have a look. If possible also provide an SVN .diff patch.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: How can I embed {TOKEN} in a URL? 2 years 4 months ago #70089

  • JEfromCanada
  • JEfromCanada's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 39
  • Thank you received: 3
  • Karma: 0
I may not need to do that after all...

I checked my online "LimeService" account and they were able to generate the correct url from a string with {TOKEN} embedded.

Either the problem has been corrected, or I did something weird in the editor while creating the original string...

When I saw that the LimeService test script was working properly, I removed my one line fix, recreated the very short LimeService script on my own site, and it ran OK (with the original register.php).

So, at this point, I don't know if there ever was an error in register.php, or whether there is an error that only manifests itself sometimes.

For now, I will keep my patch handy, but won't be forwarding it on to the bug tracker.
The administrator has disabled public write access.

Re: How can I embed {TOKEN} in a URL? 2 years 4 months ago #70099

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
Thanks for your feedback.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: How can I embed {TOKEN} in a URL? 2 years 4 months ago #70237

  • atiut
  • atiut's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 76
  • Thank you received: 2
  • Karma: 1
I may have had a similar problem. Namely, when I create a mailto link using the nice link editor LS has , all and every placeholders (like {TOKEN}) I use simply break.

I realised that this happens because the "{" sign gets translated into some code equivalent (Unicode??) the moment I close the link editor.

So no { will appear in the source code, therefore LS will not recognize the placeholder.

The solution is to delete all { and } signs in the link editor. Then close (save). Then choose the html mode in your main editor. It will look like a mess but all you need is to find your placeholder and add { and }.

It is important to delete the {} because they are at the margins of the placeholder, so you it become unclear where the placeholder starts/ends in the html editor. Some other signs do break, but they will be within the placeholders so they are easier to fix.

Another note: when editing the link you will likely need to make each modification twice. that is one for the visible text and one for the actual URL.

I could maybe write a workaround and/or put it forward to the bug tracker, but it seemed to me that I was the only one to have hit this wall :).
The administrator has disabled public write access.

Re: How can I embed {TOKEN} in a URL? 2 years 4 months ago #70239

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 5844
  • Thank you received: 715
  • Karma: 222
atiut wrote:
I could maybe write a workaround and/or put it forward to the bug tracker, but it seemed to me that I was the only one to have hit this wall :).
I allway use pop up editor mode to avoid this problem kind :)

Denis
The administrator has disabled public write access.

Re: How can I embed {TOKEN} in a URL? 2 years 4 months ago #70242

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 328
I could maybe write a workaround and/or put it forward to the bug tracker...
atiut, it seems to me that this deserves a bug report.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.143 seconds
Donation Image