Your software
My Mautic version is: 4.4.4
My PHP version is: 7.4.20
My Database type and version is: aws-rds-mysql
Your problem
Anyone else having problem that dynamic content added via Grapejs editor does not work when sent using a campaign action?
For me only the default dynamic content is sent even if a variant matches.
These errors are showing in the log:
Steps I have tried to fix the problem: I have no clue on where to start, I made a minimal campaign and a minimal email and could easily reproduce the issue.
Now I also found this git issue and I think it is very similar to what I am seeing.
Also I am getting an error when doing sudo php /var/www/mautic/bin/console mautic:campaigns:trigger -i 28
The notice I get is:
PHP Notice: Trying to access array offset on value of type null in /var/www/mautic/app/bundles/EmailBundle/Model/EmailModel.php on line 1541
and on that particular row we have $this->getRepository()->upCount($emailId, 'sent', $count, $emailSettings[$emailId]['isVariant']);
I guess isVariant has to do with the dynamic content.
But is it really like this? Is dynamic content not a priority for Mautic and do I need to find another solution?
I’m not a developer with Mautic or an expert, I have learned by trial and error almost everything on my own I have put in a few support tickets in the forum over the years. One of the first things I always do is change the version of my PHP. Like my dedicated server, I can have specific versions of php assigned to a domain I have so I can run like version 7.4 and 8.0, and 8.1 and add different configurations of extensions and limits to things and normally that fixes a lot of errors I receive with Mautic. No idea why it does that but it has worked and has been steady ever since. I also have learned that Mautic doesn’t always play nice with the hosting provider you are using for self-hosting Mautic. The server settings themselves and the specific version of Linux or whatever O/S you using. If your on shared you are even more limited in what you’re using. I also know that sometimes deleting cron jobs and reading them, or even the timings with the cron can make a difference. I usually do ssh testing of the chron for each one and see what the results are and if there are errors you start from that point. I also know that Mautic doesn’t always provide the correct information on errors on what is really taking place. You should have error logs on the domain you have it on the php log error file reporting is also handy to look at. Just some ideas and suggestions is all this is.
Thanks for the teply @ayayron however I am hosting Mautic on a dedicated server. Even thiugh I can try to change things I believe that chances to fix this by changing php version is minimal.
Especially since the dynamic content comverts to content. It is just always the default content
To me it seems that dynamic content in e-mail is broken. Totally broken. Is it working for someone please shed some light on this.
I have now made more testing. Completely new email. I cleared the dynamic content in the database to make sure it is completely fresh.
I did find a strange thing. In every email there seem to be a ”dynamic content 1” without filters and that is kot used. When adding a dynamic content block it become nr 2. I manually removed dynamic content 1 and updated referencew to dynamic content 2. but also this did not help.