Send Email Messages using Orchard Jobs Queue

Send Email Messages using Orchard Jobs Queue

The Orchard Jobs Queue in Orchard 1.8 can be used to send email asynchronously. This is especially useful when sending email from custom forms that are submitted on your Orchard Website via Orchard Workflow. Enabling email to use the new Jobs Queue is as simple as selecting a Queued option in your Send Email Workflow Activity.

Orchard Jobs Queue

Enable the Orchard Jobs Queue Module and go into the Send Email Workflow Activity and enable email messages to be queued by selecting the "Queued" checkbox. This checkbox only displays when the Jobs Queue is enabled, so if you don't see it, the Jobs Queue Module is not enabled.

Select Queued to send email message asynchronously using Jobs Queue in Orchard CMS

That's it.

Note that email messages will not be sent right away. They are queued in the Orchard Jobs Queue to be delivered in the order that they are received. You can optionally open up the Jobs Queue UI and look at them in the queue. Here we have two jobs sitting in the queue waiting to be delivered.

Orchard Jobs Queue

There are some other changes with email regarding new templates and configuring email settings in your Web.Config that you may want to investigate as well. I'll mention those at another time.

Conclusion

The Jobs Queue can be used for more than just email messaging, which makes you wonder how we can use it for our own custom Orchard Modules and other features native to Orchard CMS. You have to upgrade to Orchard 1.8 to get the new Jobs Queue.

Check out my other Orchard Tutorials and follow me on Twitter and Google+. If you're interested in hiring an Orchard Developer for your next project, contact me.