Jump to content
thirty bees forum

MailQueue module / ideas and beta-testers needed


Recommended Posts

Hi everyone,

I'm developing new module MailQueue. This module uses latest thirty bees Mail Transport functionality, so currently it can be used in bleeding edge / 1.5.0 only.

As the module name suggest, the main functionality of this module is to defer sending emails. Instead of trying to deliver email as part of business process, module will serialize and save it to storage (filesystem, redis, db). Cron or CLI queue processor (that runs in separate thread) will pick these queued emails and attempt delivery later.

You can create multiple outgoing queues, and create conditions to determine which emails should go to which queue. For example, queue for 'contact' form messages. Queue for shop admin recipients. Queue for emails that contains words 'binance' or 'viagra'. Queue for transaction emails, queue for marketing emails,...

Each queue can have different settings, of course (it wouldn't make it much sense otherwise)

  • throttling -- how many emails can be sent per hour
  • delay -- initial delay to send email 
  • failed delivery retry settings 
  • manual approval, etc 
  • retention policy -- how long do you want to keep email in the queue / after send
  • sending channel -- every queue can be send using different email transport. You can send transaction and marketing emails through differnt SMTP servers

Some benefits of this system

  1. original process is not blocked by email sending. Slow SMTP servers can block order creation process even for a few seconds.
  2. process is not interrupted by SMTP errors - if SMTP server was down, exception could be raised, and this could block process to be finalized (order not completed)
  3. this supports sending a large amount of emails easily -- enqueueing emails is fast, so you can generate a lot of emails during one request - useful for sending marketing emails to a lot of recipients 
  4. retry option - cron/cli can retry deliver email later if SMTP error occurs
  5. you can view email content before it is sent, and even after it was sent (depending on queue retention policy)
  6. delaying some emails (for example you can delay review request email by 3 days)
  7. pause queue in case of some attack
  8. email priority
  9. different sending channels

I'm currently looking for volunteers that would like to test this module, before I release it officially. 

And of course, if you have some ideas or questions, let me know. I'd love to hear them all.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...