Scheduler/CommandController for the Pro-Version

The Advent Calendar Pro extension currently has three CommandControllers for the scheduler - which are described in the following.

Advent Calendar Pro Reminder: processReminders

This scheduler sends a reminder of a new lottery competition day to visitors who have subscribed to the reminder. This means that visitors should have subscribed to the reminder and confirmed their registration. The scheduler can be set up as follows:

Class: Extbase CommandController Task
Start: 02. Dezember 20xx, 0:05 Uhr
Ende:  25. Dezember 20xx, 12:00 Uhr 
Frequenz: 60 Sekunden (jede Minute)
Parallele Ausführung: Nein

In this configuration the scheduler would run every minute. At the start of a new day, the scheduler recognises that users have not received any reminders that day. It then sends out 50 reminders per pass and repeats this process after 1 minute.

However, this means that reminders are sent in the middle of the night. Alternatively, time-shifted daily crons can be set up, eg:

25-12-15 06:30, Häufigkeit 86400
25-12-15 06:35, Häufigkeit 86400
25-12-15 06:40, Häufigkeit 86400
25-12-15 06:45, Häufigkeit 86400
25-12-15 06:50, Häufigkeit 86400
...

Warning:

50 emails are sent in one pass - ie. if you have 200 participants who have signed up for the reminder, you will need to run this job at least 4 times a day!

Each participant has a Day of the last remind field in their data record. This field registers when the last reminder was sent and ensures that no participant receives a duplicate reminder. For test purposes, this field can be set manually.

Advent Calendar Pro Lottery: processParticipants

After a competition day, this scheduler sends a CSV file of participants to an e-mail address that is linked to the lottery. You can use this if you prefer to determine the winners of the lottery yourself.

The scheduler starts at 2:01 am on 2 December and ends at 12 noon on 25 December. It has a frequency of 86400 seconds (1 day). That means that the first time it runs is during the night from the first to the second day where it processes the participants. The last time it runs is during the night from the 24th to the 25th and it determines the last participant, ie, the winner.

Class: Extbase CommandController Task
Start: 02. Dezember 20xx, 0:01 Uhr
Ende:  25. Dezember 20xx, 12:00 Uhr 
Frequenz: 86400 Sekunden (jeden Tag)
Parallele Ausführung: Nein

Each Advent calendar competition day record has a Participants sent checkbox. If the scheduler sends the participants on a particular day, it sets this checkbox so that the participants are not sent a second time. If you have done a test mailing, do not forget to uncheck this before starting the lottery!

Advent Calendar Pro Lottery: processWinners

This scheduler determines the winners of a lottery after a competition day. If there is a competition question only the correct answers will be considered.

Class: Extbase CommandController Task
Start: 02. Dezember 20xx, 0:05 Uhr
Ende:  25. Dezember 20xx, 12:00 Uhr 
Frequenz: 86400 Sekunden (jeden Tag)
Parallele Ausführung: Nein

Each Advent calendar competition day data record has a Winners determined checkbox . When the scheduler detects the winners of that day, it sets this checkbox so that they are not scored a second time. If you have tested this, don't forget to uncheck the checkbox before starting the lottery!

Info:

Even though an automatic draw of winners is possible we recommend determining or selecting the winners yourself. On days where not many participants take part, the random number generator could draw the same winner twice - which doesn't look good.

General information

All of the schedulers create a log file every time they execute. These are stored under uploads/tx_adventskalender/log/. The log file can also be sent via email - this can be activated in the settings in the extension manager.

The schedulers also execute if you simulate days. Thus, you can simulate the sending of reminders, participants and drawing winners.

Run in the command shell:

The scheduler can be run via the command line:

  1. _cli_lowlevel be_user erstellen
  2. shell: php /var/www/typo3-6.2-dist/typo3/cli_dispatch.phpsh extbase Lottery:processParticipants