Ensuring qued emails don't send when re-enabling email

Ensuring qued emails don't send when re-enabling email

This question has suggested answer(s)

On TC5.6 and below it was possible to clear out any qued emails by deleting all records from the mg_EmailQueue and mg_BulkEmailQueue tables. However now that emails are sent using the cron jobs I am not 100% sure if emails are qued in the background somehow and if email is enabled it will start sending out 100s of emails to users.

Can someone confirm how this works and if there is any risk of this happening?

Thanks

Adam

All Replies
  • Emails are generated & queued up as dynamic jobs.  Whereas cron jobs run at fixed schedules, the dynamic jobs can be scheduled on demand, allowing us to offload the generation of emails as well as the sending.  This model also means emails will get sent out sooner - you may well have noticed that particularly in local testing emails now come out within seconds as opposed to having to wait up to 2 minutes for the email job to execute.

    To clear the dynamic job queue, you can empty the following tables:

    delete from QRTZ_DYNAMIC_TRIGGERS

    delete from QRTZ_DYNAMIC_JOB_DETAILS

    delete from QRTZ_DYNAMIC_FIRED_TRIGGERS

    (n.b. I would make sure the JS is stopped before deleting from these tables)

  • Hi Alex,

    Thanks for confirming and clarifying the difference between cron and dynamic jobs. Do the dynamic jobs just keep checking for updates to the tables every few seconds then and send as soon as there is a new / altered row? I guessed that they must still be stored in the database somewhere but wasn't sure where. Also are emails the only dynamic jobs out of the box as I am assuming that's where there is no identified in the delete query to say where type = email ?

    Thanks

    Adam
  • Hi Alex,

    Do you have any information on the questions I asked above?

    thanks

    Adam