Please log in to subscribe to updates for this article
Last updated at Wed Jul 27 20:03, by lsproc
Setting up Delayed Mailing ⇑ topThe mailing module can either be set up to send email messages immediately, or to send them periodically on a delayed mailing basis. If you wish to use this delayed mailing setup, some extra configuration is necessary.
Turning on the feature ⇑ top
Setting the schedule ⇑ topAfter saving, a scheduled task must be set up, using the tbg_cli script. As with other CLI calls, the working directory that the script is executed from must be the same as the directory tbg_cli exists in, so you may wish to write a script to handle this:
cd /var/www/tbg php ./tbg_cli (parameters here - see below)For further details on the CLI, see the guide's CLI section.
The command you will need to run is:
tbg_cli mailing:process_mail_queue SERVERNAMEThis will process all mail messages in the mail queue, and send them off to their destinations. If there is an error sending a message, the CLI will display this message in the standard output (be it the console or a log).
SERVERNAME must be set to the hostname of the server. If The Bug Genie can be found at support.mysite.com/bugs, you would enter support.mysite.com here.
If you only want to send out a certain number of emails every time the script is executed, this can also be specified:
tbg_cli mailing:process_mail_queue SERVERNAME --limit=10You can substitute 10 for the number of emails you wish to send. With this setup, every time the scheduled task is executed, 10 emails (or however many you choose) will be sent.
For testing purposes, it is also possible to run the script in test mode. In this setup, the script will execute and report that it is working, but will not send any messages:
tbg_cli mailing_process_mail_queue SERVERNAME --test=yesOnce you have the script set up to your liking, you can add it as a cronjob on UNIX systems, or a Scheduled Task on Windows.