The Bug Genie
The Bug Genie
Please log in to subscribe to updates for this article
The Bug Genie:User Guide:Modules:Mailing:Delayed Mailing
Last updated at Wed Jul 27 20:03, by lsproc

Setting up Delayed Mailing  ⇑ top

The 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 to change
Setting to changeicon_open_new.png
The first step in the process is to turn on this function, which can be done from the Email Notification settings, available in Configuration. The setting is shown to the right, and should be set to Use email queueing. After making the change, remember to press Save.

Setting the schedule  ⇑ top

After 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 SERVERNAME
This 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, you would enter 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=10
You 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=yes
Once 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.

Article attachments

  • icon_download.png Setting
    delayedmail.png uploaded Jul 12, 2011 by unknown user

Article comments (12)