Hi, I have made a microflow that given a list of users sends email to them. In order to not let the user issuing the list wait I would like to use a function that performs the sending of emails in the background. ExecuteMicroflowInBackground from Community Commons does what I want since I need to send an object to the microflow in the background. The problem is that it is/seems slow even under low server load. Some emails are sent after 30 minutes. The documentation states this: "This might be useful to model for example your own batching system, or to run a microflow in its own (system) transaction. The microflow is delayed for at least 200ms and then run with low priority in a system context. Since the microflow run in its own transaction, it is not affected with rollbacks (due to exceptions) or commits in this microflow. " How low priority is low priority? It almost seemed like it was being starved by higher prioity processes even though there where low load on the server. Is it possible to increase the priority somehow?
I am not sure what you are using to send email, but the EmailTemplate module from the app store includes a queueing mechanism. Using this mechanism, you place as many emails as you want to in the queue, and the module sends queued emails via a scheduled event. This queueing mechanism also includes retries, in case there is an issue with sending an email that is caused by the receiving server, the module will try to send emails again. The number of times an email will be retried is configurable in the module.
This module may address your requirements.
I would suggest using the process queue in situations like yours. That module gives you a lot more options to define regarding what it needs to do and lets you monitor the queues. It's a bit extensive to set up correctly, but I have good experiences with it.