Custom email to contact does not import from existing template

Your software
My Mautic version is: 4.4.9
My PHP version is: 7.4.3
My Database type and version is: 10.3.38-MariaDB

Your problem
My problem is: When I want to send a custom email to a contact the normal dialog opens but if I select an existing template no content or settings are brought through. I don’t use custom mails like this very often and so I may not have done this since the 4.4.9 update. This definitely was working on the version before with my configuration.

These errors are showing in the log:
The apache log shows this error and there is one similar but longer in the Mautic log:

[Wed Jun 14 13:11:01.107452 2023] [proxy_fcgi:error] [pid 884:tid 139934505617152] [client x.x.x.x:41046] AH01071: Got error ‘PHP message: PHP Warning: Invalid argument supplied for foreach() in /var/www/mautic/docroot/app/bundles/EmailBundle/Controller/AjaxController.php on line 299’, referer:

Steps I have tried to fix the problem:

I have cleared the cache, rebuilt assets bin/console mautic:assets:generate
Restarted PHP and Apache

Bug is known - please follow here: Import custom email template broken · Issue #12296 · mautic/mautic (github.com)

1 Like

There’s now a link back to here on that issue. It mentions Chrome but I was experiencing this in Firefox 114.0.1 (64-bit).

Its probably not even related to a browser. You may just add it to the issue.

This is working again now. The only change to the system that I have made is to tweak my cron settings and add back in bin/console mautic:broadcasts:send which I’d managed to delete by mistake. Could that have been a part of the problem?

Hi, here usually helps if you rebuild your assets.

bin/console mautic:assets:generate

This usually does the job in this case.

Thanks Joey. It didn’t explicitly do that for this problem. I’m inclined to add that as a weekly cron unless there is a good reason not to?

I don’t think there is a harm if you run this command.

2 Likes