Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduled Segment Emails not sending out #310

Open
papaslumpf opened this issue Jan 20, 2025 · 7 comments
Open

Scheduled Segment Emails not sending out #310

papaslumpf opened this issue Jan 20, 2025 · 7 comments

Comments

@papaslumpf
Copy link

On my installation scheduled emails are not sending.
Looking into the configuration of "mautic_cron" instance it seems that setting a cronjob for mautic:broadcasts:send is missing.
Is this by accident or by design?

@thiagoferolla
Copy link

Having the same issue. @papaslumpf did you managed to fix it?

@duduzeta
Copy link

I'm having the same issue using v5.2.1. Has anyone made any progress in this?

@papaslumpf
Copy link
Author

Having the same issue. @papaslumpf did you managed to fix it?

Haven't tried to fix it as I'm currently still hoping that someone from the creators of the image will fix this.

To fix this you have to create your own image based on mautic/docker-mautic including all the necessary cronjobs as in https://github.com/mautic/docker-mautic/tree/mautic5/common/entrypoint_mautic_cron.sh

As I see there are currently only mautic:segments:update , mautic:campaigns:update , and mautic:campaigns:trigger handled.

Whatever the reason is.

@raymatos
Copy link

Having the same issue. @papaslumpf did you managed to fix it?

Haven't tried to fix it as I'm currently still hoping that someone from the creators of the image will fix this.

To fix this you have to create your own image based on mautic/docker-mautic including all the necessary cronjobs as in https://github.com/mautic/docker-mautic/tree/mautic5/common/entrypoint_mautic_cron.sh

As I see there are currently only mautic:segments:update , mautic:campaigns:update , and mautic:campaigns:trigger handled.

Whatever the reason is.

Are you saying there are more then these 3?

@papaslumpf
Copy link
Author

Having the same issue. @papaslumpf did you managed to fix it?

Haven't tried to fix it as I'm currently still hoping that someone from the creators of the image will fix this.
To fix this you have to create your own image based on mautic/docker-mautic including all the necessary cronjobs as in https://github.com/mautic/docker-mautic/tree/mautic5/common/entrypoint_mautic_cron.sh
As I see there are currently only mautic:segments:update , mautic:campaigns:update , and mautic:campaigns:trigger handled.
Whatever the reason is.

Are you saying there are more then these 3?

Of course, as in my initial post mentioned mautic:broadcasts:send is not triggered within the cron container. Unfortunately this is the relevant command for scheduled segment emails sending out.

@raymatos
Copy link

I was able to fix it, i think those crons are setup if you are using queue based (rabbitmq). I'll share the docker compose file i used to make it work.

It is a shame that the creators are very very slow to respond and by the looks of the PR, even becoming a contributor is not going to help as they dont even merge basic pull request.

@JuanxCursed
Copy link

I think I managed to fix that, I replaced the original cron Mautic file /opt/mautic/cron/mautic with this command:

cat << EOF > /opt/mautic/cron/mautic
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
BASH_ENV=/tmp/cron.env

* * * * * php /var/www/html/bin/console mautic:segments:update 2>&1 | awk '{print "[segments:update] " \$0}' | tee -a /tmp/stdout
* * * * * php /var/www/html/bin/console mautic:campaigns:update 2>&1 | awk '{print "[campaigns:update] " \$0}' | tee -a /tmp/stdout
* * * * * php /var/www/html/bin/console mautic:campaigns:trigger 2>&1 | awk '{print "[campaigns:trigger] " \$0}' | tee -a /tmp/stdout
* * * * * (sleep 40; php /var/www/html/bin/console mautic:segments:update) 2>&1 | awk '{print "[segments:update-delayed] " \$0}' | tee -a /tmp/stdout
* * * * * (sleep 30; php /var/www/html/bin/console mautic:campaigns:update) 2>&1 | awk '{print "[campaigns:update-delayed] " \$0}' | tee -a /tmp/stdout
* * * * * (sleep 20; php /var/www/html/bin/console mautic:campaigns:trigger) 2>&1 | awk '{print "[campaigns:trigger-delayed] " \$0}' | tee -a /tmp/stdout

* * * * * php /var/www/html/bin/console mautic:messages:send --no-interaction 2>&1 | awk '{print "[messages:send] " \$0}' | tee -a /tmp/stdout
* * * * * php /var/www/html/bin/console mautic:broadcasts:send 2>&1 | awk '{print "[broadcasts:send] " \$0}' | tee -a /tmp/stdout
* * * * * php /var/www/html/bin/console messenger:consume email --no-interaction 2>&1 | awk '{print "[messenger:consume] " \$0}' | tee -a /tmp/stdout
* * * * * php /var/www/html/bin/console mautic:webhooks:process 2>&1 | awk '{print "[webhooks:process] " \$0}' | tee -a /tmp/stdout

*/10 * * * * php /var/www/html/bin/console mautic:email:fetch 2>&1 | awk '{print "[email:fetch] " \$0}' | tee -a /tmp/stdout
*/15 * * * * php /var/www/html/bin/console mautic:email:process --no-interaction 2>&1 | awk '{print "[email:process] " \$0}' | tee -a /tmp/stdout
*/15 * * * * php /var/www/html/bin/console mautic:contacts:deduplicate --no-interaction 2>&1 | awk '{print "[contacts:deduplicate] " \$0}' | tee -a /tmp/stdout

0 3 * * * php /var/www/html/bin/console mautic:iplookup:download 2>&1 | awk '{print "[iplookup:download] " \$0}' | tee -a /tmp/stdout
0 4 5 * * php /var/www/html/bin/console mautic:maintenance:cleanup --days-old=365 --no-interaction 2>&1 | awk '{print "[maintenance:cleanup] " \$0}' | tee -a /tmp/stdout
0 1 * * * php /var/www/html/bin/console mautic:points:update 2>&1 | awk '{print "[points:update] " \$0}' | tee -a /tmp/stdout

EOF

This is a full cron for all useful stuff and this env on the docker container:
MESSENGER_TRANSPORT_DSN

Pointing to your RabbitMQ, not really sure what was the issue, but al least for me, is working with these two changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants