Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
en:create:functions:mailschedule [12.12.2014 07:55] – alexander.ritter | en:create:functions:mailschedule [12.09.2015 14:26] – [mailSchedule()] admin |
---|
''void **mailSchedule**(string //personID//, int //mailing//, int //time//)'' | ''void **mailSchedule**(string //personID//, int //mailing//, int //time//)'' |
| |
Thus function prepares the sending of a mailing directly in the questionnaire -- for example, the invitation to the second questionnaire. In contrast to ''[[:en:create:functions:mailresume|mailResume()]]'', the current interview will not be resumed. Instead, the mailing is sent in the same way as if it had been prepared manually. | This function prepares the sending of a mailing directly in the questionnaire -- for example, the invitation to the second questionnaire. In contrast to ''[[:en:create:functions:mailresume|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. | **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 interview began by way of invitation mailing, you can enter ''false'' and then a suitable ID will be automatically generated. Alternatively, the personal ID can be determined using ''[[:en:create:functions:caseserial|caseSerial()]]''. | * //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 ''[[:en:create:functions:caseserial|caseSerial()]]''. |
* //mailing//\\ (Numerical) ID of the mailing which should be sent to the participant. In the tab //Reminder/Follow-up Email// for the mailing, the value must be configured to "Reminder or Continuation" as the //Type of Follow-up Email//. Please take the notes below into consideration. | * //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. | * //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. | **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:** | **Tip:** There are numerous websites on the internet that can covert a date into a Unix timestamp. For example: [[http://www.unixtime.de/|unixtime.de]]. The PHP [[http://www.php.net/manual/en/ref.datetime.php|Date/Time Functions]] (in particular ''[[http://php.net/manual/en/function.mktime.php|mktime()]]'' and ''[[http://www.php.net/manual/en/function.strtotime.php|strtotime()]]'') are ideally suited to this purpose. |
| |
**Tipp:** Im Internet gibt es zahlreiche Websites, die ein Datum in einen Unix-Zeitstempel umrechnen können, z.B. [[http://www.unixtime.de/|unixtime.de]]. Auch die [[http://www.php.net/manual/de/ref.datetime.php|Datums- und Zeit-Funktionen]] von PHP (insbesondere ''[[http://php.net/manual/de/function.mktime.php|mktime()]]'' und ''[[http://www.php.net/manual/de/function.strtotime.php|strtotime()]]'') sind dafür hervorragend geeignet. | ===== Example ===== |
| |
===== Beispiel ===== | 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) |
| |
Ein Teilnehmer wurde per Serienmail zum Fragebogen eingeladen. 14 Tage, nachdem er auf den Link geklickt und damit den Fragebogen aufgerufen hat, soll er eine Einladung zum zweiten Fragebogen erhalten (Serienmail Nr. 2). | |
| |
<code php> | <code php> |
</code> | </code> |
| |
Anstatt die Funktion ''strtotime()'' zu bemühen, kann das Zeitinterval auch in Sekunden spezifiziert werden: 14 Tage = 336 Stunden = 1209600 Sekunden. | Instead of using the function ''strtotime()'', the time period can also be specified in seconds: 14 days = 336 hours = 1209600 seconds. |
| |
<code php> | <code php> |
mailSchedule(false, 2, 1209600); | mailSchedule(false, 2, 1209600); |
</code> | </code> |