This translation is older than the original page and might be outdated. See what has changed.
Translations of this page:
 

This is an old revision of the document!


mailSchedule()

void mailSchedule(string personID, int mailing, int time)

This function prepares the sending of a mailing directly in the questionnaire – for example, the invitation to the second questionnaire. In contrast to mailResume(), the current interview will not be resumed. Instead, the mailing is sent in the same way as if it had been prepared manually.

Note: The email will only be sent if the participant is already registered in the mailing list.

  • personID
    The personal ID of the addressee who should receive the email. If the participant began the questionnaire after receiving an invitation via mailing, you can enter false and then a suitable ID will be automatically generated. Alternatively, the personal ID can be determined using caseSerial().
  • mailing
    (Numerical) ID of the mailing which should be sent to the participant.
  • time
    Either the delay in email delivery (in seconds: maximum 153900000) or a Unix timestamp, which defines the time until the next email is sent.

Note: A mailing is sent (in contrast to mailResume()) only once per recipient, even if the function is called up repeatedly. Sending different mailings is possible – e.g. an invitation to take part in the second wave of the survey in 14 days and a further invitation to the third wave in 1 month.

Tip: There are numerous websites on the internet that can covert a date into a Unix timestamp. For example: unixtime.de. The PHP Date/Time Functions (in particular mktime() and strtotime()) are ideally suited to this purpose.

Example

A participant was invited to take part in the questionnaire via a mailing. 14 days after he clicked on the link, and thus accessed the questionnaire, he should receive an invitation to the second questionnaire (mailing no. 2)

mailSchedule(false, 2, strtotime('+14 days'));

Instead of using the function strtotime(), the time period can also be specified in seconds: 14 days = 336 hours = 1209600 seconds.

mailSchedule(false, 2, 1209600);
en/create/functions/mailschedule.1442060797.txt.gz · Last modified: 12.09.2015 14:26 by admin
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki