Check out the LimeSurvey source code on GitHub!

Iterate survey with reminders by SMS

5 years 10 months ago - 5 years 10 months ago #59406 by cycas
I'm setting up an iterate survey which will be taken daily by participants, and would like to have my users nagged by SMS rather than email to remind them to fill it in.

I wondered if anyone had done this and had any hints or tips? I'm planning on getting the SMS functionality from a specialist provider and I can already send SMS from PHP, so I just need to figure out how to pull Limesurvey into the loop now.
Last Edit: 5 years 10 months ago by cycas.

Please Log in to join the conversation.

5 years 10 months ago #59419 by cycas
... actually, now I look at it more, I don't think an iterate survey is going to do the job, iterate survey seems to need manual intervention to export the previous set of answers and then reset the tokens first, whereas what I want to do is build up a dataset over a period asking the same questions each day.

I think I'm going to have to have them log in somewhere outside of limesurvey, set up a copy of the survey for each day, and do the reminders and SMSs separately via a cron job separately. Drat.

Unless anyone has a better idea?

Please Log in to join the conversation.

5 years 8 months ago #62133 by blfesper
Don't forget that most, if not all of the US mobile carriers allow SMS message via email. (I don't know about international) If you have the carrier for each phone number, you can send the messages as email, but they will receive them as texts. A quick web search will give the email domains for the different carriers.

For example a Verizon subscriber could be reached via This email address is being protected from spambots. You need JavaScript enabled to view it.. (subbing the actual phone number for the 5's)

For the iterative piece, you could create multiple copies of the survey and utilize the start/end dates of the survey and have each active for only one day, each survey active for a different day. Import the same token file for each survey. Obviously, this would provide data for each survey separately which could be aggregated as you wish.

The only remaining issue would be automating the invitations. You could likely accomplish this using a mail merge from an external application.
As an example, I have an external MS Access database that uses queries and VBA to daily send an email with a survey link to users with which we interacted on that day a week prior. This runs on a scheduled task without any interaction from us.

You could do something similar in Access (or other database system) by building the link dynamically within VBA (or code of choice) by building a lookup table listing the survey number and the date it will be active. Reference the token table, a reference table to build the phone number/carrier email info and you have the survey link and everything else you need to send a personalized email to each recipient.

This sounds like a lot of work, but if this is a long term project for you, it may be worth it.

Please Log in to join the conversation.

5 years 8 months ago #62563 by cycas
Thanks for this suggestion. I've now completed this project (well, almost). I didn't take that approach, so I thought I'd just note how I did it in the end in case it's useful to anyone.

1) I set up a normal, open survey, which included a short text question for userid.

2) I wrote a username/password form outside limesurvey that ran a basic php script to check my (non-limesurvey) users table to see if this was one of my list of registered users.

If it was, it checked the Limesurvey table for my survey for the last date with that userid in a question field. Then it sent the user on to my survey URL with the userid and time since last logged in in the URL like this :×ince=3

3) At the survey, In the welcome message text field, I set up a Javascript which checked the URL for a userid parameter. If it didn't find it, it sent the user back to my login page. It also told the user how long it was since they last logged in if they had correctly logged in.

4) I filled the userid question from the URL, and hid it from view/editing with
<script type=text/javascript charset=utf-8>
$(document).ready(function() {

5) I wrote another simple php script, reminder.php, to select the last entry for each userid from the limesurvey table for my survey, and work out how long since they last filled it in.

If they had left it Too Long, the script checked their contact details from my table of registered users, and sent them either a nagging email or an SMS message, or both (I used the the very easy API from to do the SMS.)

6) I set up a cron job to run reminder.php once a day, thus giving my poor unfortunate (but consenting) users a choice of being nagged by phone and email, or filling the survey in once a day.

So, I didn't use the iterate survey functionality in the end, but simply had people fill it in over and over, then connected the results for analysis using the hidden userid field.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form