# Firing off Transactional Mails when there is a Queue

**URL:** https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848
**Category:** Product Support
**Created:** [April 5, 2021, 1:25pm UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848 "2021-04-05T13:25:10Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [April 5, 2021, 1:25pm UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/1 "2021-04-05T13:25:11Z")

</div>

Hi

I am trying to figure out if there is a way (even via api) that I can send a transactional email out that will bypass the current mautic queue.

My issue is that I have sending setup as a queue, however I also have transactional mailers that need to go out and are fired off from api calls. Currently I notice they are getting stuck in the queue.

Am I missing something ?

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [April 6, 2021, 8:30am UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/2 "2021-04-06T08:30:55Z")

</div>

There is no way. Each email in the queue is created equal.

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [April 6, 2021, 8:31am UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/3 "2021-04-06T08:31:48Z")

</div>

But you can run your email processing cron more frequent then others.

---

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [April 6, 2021, 11:50am UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/4 "2021-04-06T11:50:34Z")

</div>

Hey @joeyk I am not sure if I should be very excited about your response or maybe I did not understand. Is there a way to fire off a specific cron job per email id ?

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [April 6, 2021, 12:03pm UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/5 "2021-04-06T12:03:19Z")

</div>

Hey @mikew . Sorry, but there is just no way to do that. There is no option which would decide to send some emails over other emails. First come, first served.

---

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [April 6, 2021, 12:17pm UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/6 "2021-04-06T12:17:59Z")

</div>

yip this is what I thought.

However this could be a cool feature to add eventually to Mautic. If you are using Mautic for both transactional and marketing mailers I can imagine many others would face a similar challenge.

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [April 6, 2021, 12:35pm UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/7 "2021-04-06T12:35:54Z")

</div>

Yes, there could be 2 folders, transactional and marketing…

---

<div class="post-metadata">

### Author: ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)
#### Post date: [April 7, 2021, 5:19pm UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/8 "2021-04-07T17:19:16Z")

</div>

@mikew  
If you don’t have a problem using segment emails for transactional emails you can use **mautic:broadcasts:send --channel=email --id=11 --batch=50 --limit=50 -vvv**  
Enter the email ID of the email and rock on. You do have to set a publish date for this function to work. set the batch and limit appropriately to cron timing

Otherwise you can process the campaigns containing transactional emails more frequently by using **mautic:campaigns:trigger** **–campaign-id [CAMPAIGN-ID]**

You can add **[–kickoff-only] [–scheduled-only]** if that helps push them out

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [April 7, 2021, 5:26pm UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/9 "2021-04-07T17:26:34Z")

</div>

> [@EJL](#):
>
> mautic:broadcasts:send

Correct me if I’m wrong, but in case of queue setting enabled this command will not actually send the email, just queue them, right?

---

<div class="post-metadata">

### Author: ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)
#### Post date: [April 7, 2021, 5:37pm UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/10 "2021-04-07T17:37:42Z")

</div>

You are Correct. Perhaps set up a different mailer for transactional emails only. Symphony seems to support it but i never had to use it. Or disable queue, send emails direct, then re-enable as inelegant as that is.  
**swiftmailer:spool:send [–message-limit MESSAGE-LIMIT] [–time-limit TIME-LIMIT] [–recover-timeout RECOVER-TIMEOUT] [–mailer MAILER] [–transport TRANSPORT] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–]**

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [April 8, 2021, 5:51am UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/11 "2021-04-08T05:51:09Z")

</div>

Hold on.  
Different Mailier?  
You mean you could use multiple smtps?

---

<div class="post-metadata">

### Author: ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)
#### Post date: [April 8, 2021, 2:19pm UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/12 "2021-04-08T14:19:38Z")

</div>

Maybe. Perhaps using the api as mailer and/or transport would work. I have no idea if it would spool differently or if 2 spools could be designated.  
Here is the output from the command help

swiftmailer:spool:send [options]

Options:  
–message-limit=MESSAGE-LIMIT The maximum number of messages to send.  
–time-limit=TIME-LIMIT The time limit for sending messages (in seconds).  
–recover-timeout=RECOVER-TIMEOUT The timeout for recovering messages that have taken too long to send (in seconds).  
**–mailer=MAILER The mailer name.**  
**–transport=TRANSPORT The service of the transport to use to send the messages**  
-h, --help Display this help message  
-q, --quiet Do not output any message  
-V, --version Display this application version  
–ansi Force ANSI output  
–no-ansi Disable ANSI output  
-n, --no-interaction Do not ask any interactive question  
-e, --env=ENV The Environment name. [default: “prod”]  
–no-debug Switches off debug mode.  
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:  
The swiftmailer:spool:send command sends all emails from the spool.

---

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [April 8, 2021, 4:31pm UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/13 "2021-04-08T16:31:55Z")

</div>

if we are able to use a different smtp would that bypass a queue ?

---

<div class="post-metadata">

### Author: ![georg\_bnm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/georg_bnm/32/11081_2.png) [@georg\_bnm](https://forum.mautic.org/u/georg_bnm)
#### Post date: [January 8, 2024, 10:07am UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/14 "2024-01-08T10:07:33Z")

</div>

Hi @joeyk,

Wishing a great new year to you!

Just wanna ask, how this could work with marketing emails sending over the queue and other emails as DOI or transactional will send immediately.

Which cronjob interval has to be adjusted?

Thanks in advance!

Best,  
Georg

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [January 8, 2024, 11:48am UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/15 "2024-01-08T11:48:33Z")

</div>

Queue should be just one in my opinion.

But the email generation can be done in different frequency. You can generate the campaign email at a different frequency by specifying the --campaign-id[=CAMPAIGN-ID] in your mautic:campaign:trigger command.

This way emails which need to go out more frequent are generated more frequent .

---

<div class="post-metadata">

### Author: ![georg\_bnm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/georg_bnm/32/11081_2.png) [@georg\_bnm](https://forum.mautic.org/u/georg_bnm)
#### Post date: [January 8, 2024, 6:19pm UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/16 "2024-01-08T18:19:37Z")

</div>

So, this mean an extra cronjob only for that campaign or email?

Thanks.

Best,  
Georg

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [January 8, 2024, 6:20pm UTC](https://forum.mautic.org/t/firing-off-transactional-mails-when-there-is-a-queue/18848/17 "2024-01-08T18:20:33Z")

</div>

This is how I can imagine. Unless you do a special bash script to run it.  
(We do it for certain clients.)
