Async Mail
Last updated
Last updated
The module allows you to either send mail asynchronously or queue it in an in-memory queue so it can be delivered by the mail services scheduler. So let's explore the asynchronous nature of cbmailservices.
You can easily send mail asynchronously via the ColdBox Async Manager using the sendAsync()
method. This will return to you a ColdBox Future object, which then you can use to setup an async pipeline to p
You can also detach the mail and let the cbmailservices Mail Queue send it for you. The module's mail scheduler runs on a one-minute interval and will send any mail found in the processing queue. All you need to do is use the queue()
method and be done!
The queue
method will return back a task ID guid, which you can use to track the task down in your logs or via the Mail Service.
The mail scheduler is on by default for convenience but is only needed when using the asynchronous mail feature. It can be turned off, if desired, by these steps:
Open config/coldbox.cfc
In the modulesSettings section, add a key for cbmailServices with the property runQueueTask
set to false
. See the Configuration section for more details.