Welcome to the LimeSurvey Community Forum

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

Dynamically insert email into participants table captured from question

  • bulgin
  • bulgin's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
5 years 1 month ago #180832 by bulgin
The issue we have is that we don't know the participant's email until they take the survey - they are directed to our limesurvey questionnaire after receiving a postal letter.

We would like to send the participant a confirmation of survey taken email using the email address they give us as the first question in the survey.

Can expression manager or some other technique be used to take the email given in one question and input that into the participant's table email address for that participant?

Thank you.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 month ago #180836 by tpartner
No, Expression Manager cannot modify the token table.

Instead of using the confirmation mail, modify one of the notification mails and use the value of your "email" question in the "To" field - manual.limesurvey.org/Notifications_%26_..._notifications_email

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 month ago #180841 by DenisChenu

tpartner wrote: No, Expression Manager cannot modify the token table.

gitlab.com/SondagesPro/TokenManagement/updateTokenByResponse
;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 month ago #180857 by tpartner
Yes, but that's not Expression Manger. :)

You can also use the API (I have often done this), but, again, not core functionality.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 month ago #180858 by DenisChenu

tpartner wrote: Yes, but that's not Expression Manger. :)

It use ;)

tpartner wrote: You can also use the API (I have often done this), but, again, not core functionality.

Yes :).

But : in my opionion : it must not be in core.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • bulgin
  • bulgin's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
5 years 1 month ago #180892 by bulgin
Hello and thank you both for the excellent advise. Does the updateTokenByResponse update the field literally *after* submission in a way that the outbound confirmation/admin email will not have access to the email address submitted by the survey participant for immediate use by Lime Survey in the outbound email?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 month ago #180897 by DenisChenu
I'm unsure on this point, i don't remind if email confirmation is sended before or after the event …

Must test

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • bulgin
  • bulgin's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
5 years 1 month ago - 5 years 1 month ago #180898 by bulgin
I see by your excellent post here:

extensions.sondages.pro/about/install-an...-for-limesurvey.html

I just pull it into the plugin directory by changing into the plugin directory and doing:

sudo git clone gitlab.com/SondagesPro/TokenManagement/u...eTokenByResponse.git

then it's necessary to chown the directory and all files under that directory to the user of your apache or webserver ownership.
Last edit: 5 years 1 month ago by bulgin.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 month ago #180901 by DenisChenu

bulgin wrote: then it's necessary to chown the directory and all files under that directory to the user of your apache or webserver ownership.

Apache need only read access on this plugin :).

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • bulgin
  • bulgin's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
5 years 1 month ago - 5 years 1 month ago #180912 by bulgin
My tests show that yes, this excellent plugin succeeds in entering the associated field into the participant's database, but after the email is already sent. And the email only get's sent if the admin template is used and it pulls the email from the input into the survey question, which does satisfy the mission.

Another way to do this without affecting core functionality would be to run a cron job that checks the lime_tokens table in mysql, attach a value to another field (emailsent) in that table say 0 for no email sent and 1 for email sent, then update that accordingly when the email entry is made into that table via the plugin, and take that value along with the URL that needs to be mailed, and send an email to the recipient and then set the emailsent value to 1.

Actually probably better to create a totally separate table and not interfere with the tokens table and do all the mysql'ing there.
Last edit: 5 years 1 month ago by bulgin.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 month ago #180921 by DenisChenu

bulgin wrote: My tests show that yes, this excellent plugin succeeds in entering the associated field into the participant's database, but after the email is already sent. And the email only get's sent if the admin template is used and it pulls the email from the input into the survey question, which does satisfy the mission.

OK,

Than you : please : can you report an issue gitlab.com/SondagesPro/TokenManagement/u...kenByResponse/issues

I search if i can fix it (but after doing the manual, the README and the config.xml … :unsure: )

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose