Scheduler commands for the Pro-Version
The Adventcalendar Pro extension currently has three commands for the scheduler:
Advent Calendar Pro Reminder: sendReminders
This scheduler sends a reminder for a new 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: Execute console commands (scheduler) 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 being 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 ...
50 emails are being 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 reminder 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: sendParticipants
After a competition day, this scheduler sends a CSV file of participants to an email 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: Execute console commands (scheduler) 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: determineWinners
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: Execute console commands (scheduler) 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!
Even though an automatic draw of winners is possible we recommend determining the winners yourself. On days where not many participants take part, the random number generator could draw the same winner twice - which may be unwanted.
All of the schedulers create a log file every time they execute. The TYPO3 core logging function is used. Log files will be stored in "var/log", which is in "typo3temp/" or outside the document root (when you use composer). (see https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Logging/Configuration/Index.html).
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 commands can be run via the command line:
vendor/bin/typo3 adventskalender_pro:sendreminders vendor/bin/typo3 adventskalender_pro:sendparticipants vendor/bin/typo3 adventskalender_pro:determinewinners