# Failed to execute campaign event , email are not triggered inside campaigns

**URL:** <https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844>\
**Category:** Product Support\
**Tags:** community\
**Created:** [April 4, 2021, 11:54pm UTC](https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844 "2021-04-04T23:54:03Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![zak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zak/32/587_2.png) [@zak](https://forum.mautic.org/u/zak)\
**Post date:** [April 4, 2021, 11:54pm UTC](https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844/1 "2021-04-04T23:54:03Z")

</div>

**Your software**  
My Mautic version is: 3.3.2  
My PHP version is: 7.3.27  
Database version: Percona Server for MySQL 5.7.31-34

**Your problem**  
Emails are not sent using campaigns !

I want to use queued email , for testing purpose I put 1 email every 5 min and I did the following steps:  
-Create a segment that contains 3 users and publish it  
-Create a 2 campaigns (transactional & marketing) and send 2 different emails  
-Publish the campaigns and wait  
-I got notifications with this message

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/00900d3c25b6b6edf2b76fdf13a3386b9e9c5c5a.png)

There is no error in the logs !

**Steps I have tried to fix the problem:**  
-Clear the cache  
-Run cronjob manually to see if there is any error and double check the cron file (no issue)  
-Check Path to the cache directory & to log directory (no issue)  
-Upgrade to the last version of mautic (no issue)  
-Delete & create the campaigns  
-Test email sending from the configuration and send manual email (no issue)  
-Added --env=prod at the end of every cron job  
-Change the trigger from every 5min to every 1min…

This is my cron file

> 8,23,38,52 \* \* \* \* www-data php /var/www/html/bin/console mautic:segments:update \> /var/log/cron.pipe 2\>&1 --env=prod  
> \*/5 \* \* \* \* www-data php /var/www/html/bin/console mautic:import \> /var/log/cron.pipe 2\>&1 --env=prod  
> 5,20,35,50 \* \* \* \* www-data php /var/www/html/bin/console mautic:campaigns:rebuild \> /var/log/cron.pipe 2\>&1 --env=prod  
> 2,17,32,47 \* \* \* \* www-data php /var/www/html/bin/console mautic:campaigns:trigger \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0,15,30,45 \* \* \* \* www-data php /var/www/html/bin/console mautic:messages:send \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0,15,30,45 \* \* \* \* www-data php /var/www/html/bin/console mautic:emails:send \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0,15,30,45 \*/1 \* \* \* www-data php /var/www/html/bin/console mautic:email:fetch \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0,15,30,45 \* \* \* \* www-data php /var/www/html/bin/console mautic:social:monitoring \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0,15,30,45 \* \* \* \* www-data php /var/www/html/bin/console mautic:webhooks:process \> /var/log/cron.pipe 2\>&1 --env=pord  
> 0,15,30,45 \*/1 \* \* \* www-data php /var/www/html/bin/console mautic:broadcasts:send \> /var/log/cron.pipe 2\>&1 --env=prod  
> \* 1 \* \* \* www-data php /var/www/html/bin/console mautic:maintenance:cleanup --days-old=365 \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0 4 15 \* \* www-data php /var/www/html/bin/console mautic:iplookup:download \> /var/log/cron.pipe 2\>&1 --env=prod  
> \*/5 \* \* \* \* www-data php /var/www/html/bin/console mautic:reports:scheduler \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0 5 10 \* \* www-data php /var/www/html/bin/console mautic:unusedip:delete \> /var/log/cron.pipe 2\>&1 --env=prod

I have tried many stuff and browse almost all issues in the forum and GitHub discussions but sadly I am blocked and my campaigns are not working .

This is what I get wen I run “php console mautic:campaigns:trigger”

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/8/8d8eb13ecca0f0fa52527d9f2fef2efa523bbfc2.png)

Email configuration in mautic

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/6ceeb43b1b2dd0e9c2051a112f9db9f7eda6bd16.png)

Test email

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/04d8200c092f184bc47fab73b946763ebf4bd110.png)

---

<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, 6:12am UTC](https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844/2 "2021-04-05T06:12:29Z")

</div>

Hey @zak

Could you post a screenshot of your segment filters and also a screenshot of your campaigns and the actions.

From the console output to me it looks like your campaign is working, however it is failing or going down the negative path on the scheduled event.

Interesting to see the other screenshots and see if we can help you troubleshoot this.

---

<div class="post-metadata">

**Author:** ![zak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zak/32/587_2.png) [@zak](https://forum.mautic.org/u/zak)\
**Post date:** [April 5, 2021, 7:54am UTC](https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844/3 "2021-04-05T07:54:44Z")

</div>

Thanks for your reply @mikew

This is a screenshot of my segment, we can see that I have 3 contacts

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/d/d69f85534b834bdc3317c5562a301c10f13209c7.png)

The campaigns & actions

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/4/41f7cd04a224c2ef467e64dfa2e4417783dfcda3.png)

Actions are always pending

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/af9c88d9181c56c82912001df309699e020a1883.png)

Preview of the builder

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/691c4e364b5ba9d37826c960959bdcbcf1e46cad.png)

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/66f685c0a0680bf2894efca0cbe6bbbcb6cfadde.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/ad2ccb93007c31e652b914f804198cfe0f04e370.png)

The emails are published and this is the 2 cronjob that I have changed :

> \*/2 \* \* \* \* www-data php /var/www/html/bin/console mautic:emails:send \> /var/log/cron.pipe 2\>&1 --env=prod  
> \*/2 \* \* \* \* www-data php /var/www/html/bin/console mautic:broadcasts:send \> /var/log/cron.pipe 2\>&1 --env=prod

---

<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, 11:17am UTC](https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844/4 "2021-04-05T11:17:38Z")

</div>

Hey thanks for that. Sorry forgot to ask, can you also check your logs

/var/log/nginx/mautic.error

or for apache2  
/var/log/apache2/mautic.error

Another thing go to your contacts first and in the top right, click on campaigns  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/0e041fcb1d7dc91057933b68ee56b98566115f54.png)  
remove them from the campaign and then re-add them. Simply turn the switch on and off, also please make sure for this campaign contacts can restart campaign.

Then go check out your logs, I like to watch them live with the command: tail -f /var/log/nginx/mautic.error

---

<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:38am UTC](https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844/5 "2021-04-06T08:38:46Z")

</div>

What happens if you change to transactional email?  
Maybe you have a frequency setting, that prohibits the send.  
Also: you should use the native Amazon SMTP integration via port 465, not Custom SMTP.

---

<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:26pm UTC](https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844/6 "2021-04-07T17:26:35Z")

</div>

Run **www-data php /var/www/html/bin/console swiftmailer:spool:send** in ssh. If it works add it to your cron jobs

---

<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:30pm UTC](https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844/7 "2021-04-07T17:30:26Z")

</div>

Correct. But it will send out the queue.  
The issue here is, that he has

1. bunch of newsletters to blast out that takes hours
2. transactional emails, which need to go out right away

So how can he prioritize the transactional emails (should go out immediatly) even if there is a huge flow of broadcast emails “blocking” the pipeline? So he will have mixed emails in the queue: transactional and broadcast. How to give priority to the transactional? 🙂

GEEZ I’M SUCH AN IDIOT.  
This is another thread…  
My Apologies, it’s late.

---

<div class="post-metadata">

**Author:** ![zak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zak/32/587_2.png) [@zak](https://forum.mautic.org/u/zak)\
**Post date:** [April 7, 2021, 6:00pm UTC](https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844/8 "2021-04-07T18:00:18Z")

</div>

Hi @mikew ;  
This is the logs from apache2/error.log

AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using X.X.X.X (Ip address). Set the ‘ServerName’ directive globally to suppress this message  
[Mon Apr 05 19:38:12.303469 2021] [mpm\_prefork:notice] [pid 11] AH00163: Apache/2.4.38 (Debian) PHP/7.3.27 configured – resuming normal operations  
[Mon Apr 05 19:38:12.303507 2021] [core:notice] [pid 11] AH00094: Command line: ‘apache2 -D FOREGROUND’

I don’t see the nginx logs. FYI, I am using mautic with docker.

After investigation, I migrate mautic to the last version and did another test with small dataset (1 email very 2 min) it worked perfectly for both marketing and transactional emails. The segment size is 10 emails.

But, I am still confused about mautic campaigns because today I did a bigger test with a large data (20 emails in 1h) and I don’t know if it is working or not !

This is an example of my last test :

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/7/76ca76cb201ddfe18c2b42174933662a06fe857a.png)

As you can see, it says that all actions are completed and the campaign statistics does not show any other information.

When I go to calendar, I got the following :

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/629eba1e5702f42652b360a4a07bda9aec0be85f.png)

The campaign triggers at 4:17 pm and send 20 emails, and according to my cronjob it should send another 20 emails at 5:17.

How can I know if the campaigns are working as expected ?

Like I said before, for a small campaigns it worked because I checked the time manually for every email (10 emails ^^).

This is my last cronjob configuration :

> 8,23,38,52 \* \* \* \* www-data php /var/www/html/bin/console mautic:segments:update \> /var/log/cron.pipe 2\>&1 --env=prod  
> \*/5 \* \* \* \* www-data php /var/www/html/bin/console mautic:import \> /var/log/cron.pipe 2\>&1 --env=prod  
> 5,20,35,50 \* \* \* \* www-data php /var/www/html/bin/console mautic:campaigns:rebuild \> /var/log/cron.pipe 2\>&1 --env=prod  
> 2,17,32,47 \* \* \* \* www-data php /var/www/html/bin/console mautic:campaigns:trigger \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0,15,30,45 \* \* \* \* www-data php /var/www/html/bin/console mautic:messages:send \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0 \* \* \* \* www-data php /var/www/html/bin/console mautic:emails:send \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0,15,30,45 \* \* \* \* www-data php /var/www/html/bin/console mautic:email:fetch \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0,15,30,45 \* \* \* \* www-data php /var/www/html/bin/console mautic:social:monitoring \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0,15,30,45 \* \* \* \* www-data php /var/www/html/bin/console mautic:webhooks:process \> /var/log/cron.pipe 2\>&1 --env=pord  
> 0 \* \* \* \* www-data php /var/www/html/bin/console mautic:broadcasts:send \> /var/log/cron.pipe 2\>&1 --env=prod  
> \* 1 \* \* \* www-data php /var/www/html/bin/console mautic:maintenance:cleanup --days-old=365 \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0 4 15 \* \* www-data php /var/www/html/bin/console mautic:iplookup:download \> /var/log/cron.pipe 2\>&1 --env=prod  
> \*/5 \* \* \* \* www-data php /var/www/html/bin/console mautic:reports:scheduler \> /var/log/cron.pipe 2\>&1 --env=prod  
> 0 5 10 \* \* www-data php /var/www/html/bin/console mautic:unusedip:delete \> /var/log/cron.pipe 2\>&1 --env=prod

@joeyk About the Amazon configuration, for now it works. What is the cons using custom SMTP ? I don’t want to change it right now because I am afraid that I will cause a new issue !

---

<div class="post-metadata">

**Author:** ![zak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zak/32/587_2.png) [@zak](https://forum.mautic.org/u/zak)\
**Post date:** [April 8, 2021, 9:20am UTC](https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844/9 "2021-04-08T09:20:49Z")

</div>

Update  
I checked amazon SES and it seems to work

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/f/f69cf502c36fc102e816929ae04cd12459d6b107.png)

---

<div class="post-metadata">

**Author:** ![zak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zak/32/587_2.png) [@zak](https://forum.mautic.org/u/zak)\
**Post date:** [April 9, 2021, 4:55pm UTC](https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844/10 "2021-04-09T16:55:46Z")

</div>

Hi guys,

I want to give you an update about my issue.

Unfortunately, it does not work since yesterday afternoon I am stuck with 480 emails, today 0 emails were send

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/8/8f25414932590f2ec0aca9522f738ba239f4dda3.png)

@EJL I tried your cronjob but this is not what I am expecting, I want to send 20 emails every 1h, and when I launched your cronjob in ssh mode it sends many emails

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/21ab2629d8ba32bac566a7a6dc5d4ee926d7653e.png)

Any idea about this issue guys?

Kind regards

---

<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 9, 2021, 6:55pm UTC](https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844/11 "2021-04-09T18:55:28Z")

</div>

> [@EJL](#):
>
> Run **www-data php /var/www/html/bin/console swiftmailer:spool:send** in ssh. If it works add it to your cron jobs

Run this once an hour **swiftmailer:spool:send --message-limit=20 --time-limit=20**

---

<div class="post-metadata">

**Author:** ![zak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zak/32/587_2.png) [@zak](https://forum.mautic.org/u/zak)\
**Post date:** [April 11, 2021, 7:01pm UTC](https://forum.mautic.org/t/failed-to-execute-campaign-event-email-are-not-triggered-inside-campaigns/18844/12 "2021-04-11T19:01:09Z")

</div>

Thanks for your answer @EJL

Now, I am confused because I thought that `mautic:emails:send` is calling internally `swiftmailer:spool:send`.

After adding this cronjob I got 40 emails sent every 1h. Could you please explain why it works now?

Why the statics are not clear in the dashboard ?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/06c03146ff3301a4f77c52299b4c935ed0b48ae2.png)

When I started the campaign I got 11878 contacts added (yellow color) but I don’t know if the email was scheduled or sent to the contact

how can I have better statics?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/8/876740990f32c78ffc18f19098b374957ba17f51.png)

This is what I got in the channels-\>emails page

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/a9ee68acf53a37f521a34311b9bfa96b44aefe87.png)

Even in the dashboard, I don’t get better information except how many users read the email, clicks …etc

Kind regards
