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 feature is currently only available for the Public-Mode. For this all participants are selected, who has activated the reminder and has confirmed his email-address.
The scheduler can be set up as follows:
Class: Execute console commands (scheduler) Schedulable Command: adventskalender_pro:sendparticipants: Sends reminders to participants via email. 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. If a participation is more than 24h ago and the last reminder was enabled, a reminder mail will be send.
It sends out 50 reminders per execution by default and repeats this process again after 1 minute. However, the amount of reminders can be adjusted as a parameter in the scheduler.
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) Schedulable Command: adventskalender_pro:sendparticipants: Sends reminders to participants via email. 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