0 votes
in SoSci Survey (English) by s116799 (120 points)

I write because my question was not answered below, cannot reach you through e-mail and you may need further infos to be able to help me.

I have designed a 2-wave questionnaire in your platform by using a single questionnaire. I want to send the url link via an external platform (I use a mailing list from the Uni). I ask participants to provide their e-mails by the end of wave 1 survey but I do not know how to automatically store such e-mail address using php code as to send them an e-mail later with wave 2 survey.

Therefore, could you please provide me with a minimal working example in which:
1) In page 1, there is a box in which the participant types in his/her e-mail (which should be stored if we are to use mailSend())
2) In page 2, there is the last page of wave 1, with the text "Last page of Wave 1". This page should not have the next button.
After page 2 is shown for the first time, an e-mail should be sent 90 seconds later to the e-mail recipient. The e-mail should display a link to the url of the questionnaire starting at page 3 and not at page 1 (can this be done with mailSend(), say by passing the url of the questionnaire as string, or do I really need to use mailResume? Also, 2.5 Should there be a page in between 2 and 3? If so, please consider it too.
3) In page 3, there is the first page of wave 2, with the text "First page of Wave 2". This page should have the next button. Page 3 should only be accessible at the same time the e-mail has been sent, meaning that the questionnaire should pause at page 2 for a while.

Many thanks in advance!

s116799,

Your question on SoSci Survey Online Support has been answered by SoSci Survey:

I need an id for the category "mailing" Please create a mailing in Invotation Mailing -> Mailings. When stored, you will see an ID for this mailing in the above menu. > Also, I do not get quite well how this can be used in combination with the buttonHide function... Well, the manuel [Example: Pause Between Survey Waves][1] gives a start. Could you possibly specify your question a bit further? > I tried to center the images I inserted for my experimental treatments and include commands such as "margin" but the button "next" is still too far below the image... Depends on how you embedded the image. Please feel free to add some HTML code to your question. [1]: https://www.soscisurvey.de/help/doku.php/en:create:functions:buttonhide

Your question was:

use respondent e-mail to re-send questionnaire

If you like this answer, you may select it as the best:

https://support.soscisurvey.de/?qa=15259/use-respondent-e-mail-to-re-send-questionnaire&show=15275#a15275

Thank you,

SoSci Survey Online Support

1 Answer

0 votes
by SoSci Survey (302k points)

I ask participants to provide their e-mails by the end of wave 1 survey but I do not know how to automatically store such e-mail address using php code as to send them an e-mail later with wave 2 survey.

Okay, let's solve this step-by-step.

Step 1: Do you have an opt-in question?

Step 2: Did you read the manual Multi-Wave Surveys with Self-Recruited Respondents? If yes, please specify where it becomes unclear, because only then I can tell you something different here in the online support.

by s116799 (120 points)
Hi,
I went through your instructions in here (https://www.soscisurvey.de/help/doku.php/en:survey:opt-in-live, request e-mail address at the end of the first questionnaire) and:
1. created 3 mailing lists (1 for the first wave, 2 for the following reminders, with ids 1, 2 and 3), where I included the questionnaire url.
2. created an opt-in question where respondents can leave their e-mail addresses and placed it at the end of wave1 in my questionnaire.
3. created an (in-between waves) page where I included php code following the example you provide on the aforementioned link under the title "PHP Code on Time 1". I wrote 60 seconds, 120 seconds, and 180 seconds for the reminders to check whether I would receive an e-mail, see:

// Time which the page interruption was first accessed in stored in the $timepart1 variable.
// isset() und registerVariable() prevent this time being changed when the page is accessed again (e.g. if the page is refreshed) and/or emails being duplicated.
if (!isset($timepart1)) {
  // store time
  $timepart1 = time();
  registerVariable($timepart1);
 
  // Send invitation with mailing ID 1 for the second period of measurement after 7 days
  // Time interval always given in seconds 10 x 24 x 3600 seconds = 10 days
  mailResume(false, 1, 60);
 
  // Send first reminder email with mailing ID 2 after 12 days
  // (i.e. two days after the first invitation to the second period of measurement)
  mailResume(false, 2, 120);
 
  // Send second reminder email with mailing ID 3 after 11 days
  // (i.e. four days after the first invitation)
  mailResume(false, 3, 180);
}
 
// Check how much time has passed since the page was first accessed
if ((time() - $timepart1) < 60) {
  // Display page interruption if this is less than 10 days,
  // so participants cannot see the questions in the second period of measurement before this time has passed.
  option('resume', true); // No indication that the interview is being resumed.
  option('nextbutton', false); // Hide Next button (Interview interrupted)
  text('end1');  // Maybe display a farewell indicating the end of the first part of the interview.
} else {
  // If the participant returns after 7 days, making the current time minus the new time variable
  // more than 10 days, then the survey will be resumed on the next page.
  goToPage('next');
}  
4. I called the last page (farewell) of wave 1 "end1" (ID), after which I placed the interruption page, and then the salutation page of wave2.
After running the first part of the survey (wave 1), the following message errors show up:
Questionnaire Error (page 43)
This interview has not been started in context of a mailing. Therefore, mailResume() cannot identify the appropriate recipient.
Questionnaire Error (page 43)
This interview has not been started in context of a mailing. Therefore, mailResume() cannot identify the appropriate recipient.
Questionnaire Error (page 43)
This interview has not been started in context of a mailing. Therefore, mailResume() cannot identify the appropriate recipient.
Questionnaire Error (page 43)
There is no text with the ID end1 in this survey project.

What is it exactly that I am doing wrong? and what does the command "text" stand for? Thanks!!
by SoSci Survey (302k points)
> 1. created 3 mailing lists (1 for the first wave, 2 for the following reminders, with ids 1, 2 and 3), where I included the questionnaire url.

Okay, that sounds like an issue. You should always (!) use the placeholders %link% and %link.html%, respectively, never the URL.
by SoSci Survey (302k points)
> This interview has not been started in context of a mailing. Therefore, mailResume() cannot identify the appropriate recipient.

When using the opt-in, it is important if this is a single opt-in or a double opt-in?
by s116799 (120 points)
I tried everything (double opt-in and save directly). A person id is stored in the collected data view dataset but I do not receive any e-mail with the second part of the questionnaire (wave 2). I would only want to send an e-mail with wave 2 survey after 1 min has passed from the completion of the first part of the survey (single questionnaire). I have also removed all the reminders to avoid complications, but it does not work anyways.

On the comment above, I used the placeholders %link% in the "content" box of the mailing list and %link.html% for the Content (HTML version) box. I added again in the "questionnaire url" section and the box hyperlink html. The html link does not work and had to include the by default option <a href="%link.attr%" style="text-decoration: none; font-weight: bold">&rarr; Start Survey</a>.
I now recieve 2 instead of 4 error messages but are the same, namely:
Questionnaire Error (page 43)
This interview has not been started in context of a mailing. Therefore, mailResume() cannot identify the appropriate recipient.
Questionnaire Error (page 43)
There is no text with the ID end1 in this survey project.

Is there any way you could take a look at my questionnaire to check where the issue is? I consulted with 2 other colleagues, we cannot figure out what is wrong and really need to send this survey around...Thanks again for your swift responses
by SoSci Survey (302k points)
> I tried everything (double opt-in and save directly).

Which one do you want to use? Depending on that you either have to use the value() from the opt-in question as first parameter in mailResume() or you have to place the mailResume() in a second questionnaire that starts when the email-address is confirmed (double opt-in).
by s116799 (120 points)
I included the id of the opt-in question inside value() now, so the code for mailResume() is mailResume(value(P292), 1, 60). I now receive 2 e-mails after one minute (one re-directing to first wave again; the second one to second wave, as it should be the case). Also, I get the following error messages once I finish wave 1:
Questionnaire Error (page 43)
There is no text with the ID end1 in this survey project.
Questionnaire Error (page 43)
There is an error in the PHP code:
Questionnaire Error: Use of undefined constant P292 - assumed 'P292' (this will throw an Error in a future version of PHP)
line: 12

PHP code

009  
010   
011   
012   mailResume(value(P292), 1, 60);
013  
014   
015   
Any clue what's wrong?
by SoSci Survey (302k points)
Please make sure to set the quotation marks correctly:

mailResume(value('P292'), 1, 60);

> I now receive 2 e-mails after one minute (one re-directing to first wave again; the second one to second wave, as it should be the case).

If you receive two emails, there must be more code, or the double opt-in is enabled?!

> There is no text with the ID end1 in this survey project.

This warning is not related to the code from above. Probably you are using a goToPage() or setNextPage() or a setPageOrder() previously.

> Use of undefined constant P292 - assumed 'P292' (this will throw an Error in a future version of PHP)

This is the missing quotations marks I mentioned above.
by s116799 (120 points)
Ok, now everything is solved except for the first point (2 e-mails received). No double opt-in is enabled, only "save directly, no confirmation e-mail". Unfortunately,  I keep receiving 2 e-mails...No more code added, I believe, check my page in-between code:
// Time which the page interruption was first accessed in stored in the $timepart1 variable.
// isset() und registerVariable() prevent this time being changed when the page is accessed again (e.g. if the page is refreshed) and/or emails being duplicated.
if (!isset($timepart1)) {
  // store time
  $timepart1 = time();
  registerVariable($timepart1);
 
  // Send invitation with mailing ID 1 for the second period of measurement after 7 days
  // Time interval always given in seconds 10 x 24 x 3600 seconds = 10 days
  mailResume(value('P292'), 1, 60);
 
  // Send first reminder email with mailing ID 2 after 12 days
  // (i.e. two days after the first invitation to the second period of measurement)
//  mailResume(false, 2, 120);
 
  // Send second reminder email with mailing ID 3 after 11 days
  // (i.e. four days after the first invitation)
  //mailResume(false, 3, 180);
}
 
// Check how much time has passed since the page was first accessed
if ((time() - $timepart1) < 60) {
  // Display page interruption if this is less than 10 days,
  // so participants cannot see the questions in the second period of measurement before this time has passed.
  option('resume', false); // No indication that the interview is being resumed.
   option('nextbutton', false); // Hide Next button (Interview interrupted)
text('P293');  // Maybe display a farewell indicating the end of the first part of the interview.
} else {
  // If the participant returns after 7 days, making the current time minus the new time variable
  // more than 7 days, then the survey will be resumed on the next page.
  goToPage('next');
}
by SoSci Survey (302k points)
> Unfortunately,  I keep receiving 2 e-mails...

Most likely not from THIS code. Could you specify how the mails differ? Is it the same link they contain? Could you post the link targets from a "pair" here?
by s116799 (120 points)
The 2 e-mails I receive:

Vielen Dank, dass Sie sich auch ein zweites Mal für unsere Umfrage zu Thema "Dronen" Zeit nehmen.

Nach diesem zweiten Teil der Befragung werden Sie 10 Studienteilnahmepunkte im Assessmentstudium gutgeschrieben bekommen.

Bitte klicken Sie auf den bereitgestellten Link auf den Fragebogen, um die Teilnahme zu starten:
https://www.soscisurvey.de/lch/?l=eng&d=78367XSMGWQGNDR2

mail 2:

Vielen Dank, dass Sie sich auch ein zweites Mal für unsere Umfrage zu Thema "Dronen" Zeit nehmen.

Nach diesem zweiten Teil der Befragung werden Sie 10 Studienteilnahmepunkte im Assessmentstudium gutgeschrieben bekommen.

Bitte klicken Sie auf den bereitgestellten Link auf den Fragebogen, um die Teilnahme zu starten:
https://www.soscisurvey.de/lch/?i=SXCYKW7Q73FM

Additionally, now I found out that for 2 of the 3 Treatments, wave 2 keeps repeating again and again (there's no way to finish it). Treatments in both waves are well-randomized, but have no clue what may be causing that...
by SoSci Survey (302k points)
Okay, the first one is a mailing, the second one is a mailResume().

So here's my guess where the mailing comes from:
https://support.soscisurvey.de/?qa=15654/fragetyp-opt-fur-mail-verteiler-funktionalitat-double-opt&show=15660#a15660

(as all your contents is in German, I assume you speak German. By the way: you're aware that SoSic Survey is located in Munich?)
by s116799 (120 points)
I followed the instructions I now receive one e-mail to wave 2, but I still have the problem pointed above: for 2 of the 3 Treatments, wave 2 keeps repeating again and again (there's no way to finish it)...can it be something linked to the code showed above? I know you are located in Germany, but I am much slowlier writing in German than in English, that's why :-)
by SoSci Survey (302k points)
>  for 2 of the 3 Treatments, wave 2 keeps repeating again and again

Would you mind clearing this in a new question. I think we have earned some more clarity given that we have resolved the two-mails issue and the original question in this thread :)

> wave 2 keeps repeating again and again

In the new question, please post the code that separated the treatments. Possibly, you're working with setPageOrder() or something like this?
by s116799 (120 points)
OK, Ich habe den Fehler gefunden! Ich hatte 2 Seite mit dem gleichen Name! Jetzt bin ich bereit zu weigh anchor! Danke für eure Hilfe!

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...