# Custom email to contact does not import from existing template

**URL:** <https://forum.mautic.org/t/custom-email-to-contact-does-not-import-from-existing-template/28315>\
**Category:** Product Support\
**Created:** [June 14, 2023, 12:29pm UTC](https://forum.mautic.org/t/custom-email-to-contact-does-not-import-from-existing-template/28315 "2023-06-14T12:29:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnhannawin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/johnhannawin/32/7859_2.png) [@johnhannawin](https://forum.mautic.org/u/johnhannawin)\
**Post date:** [June 14, 2023, 12:29pm UTC](https://forum.mautic.org/t/custom-email-to-contact-does-not-import-from-existing-template/28315/1 "2023-06-14T12:29:04Z")

</div>

**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

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [June 14, 2023, 1:34pm UTC](https://forum.mautic.org/t/custom-email-to-contact-does-not-import-from-existing-template/28315/2 "2023-06-14T13:34:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![johnhannawin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/johnhannawin/32/7859_2.png) [@johnhannawin](https://forum.mautic.org/u/johnhannawin)\
**Post date:** [June 14, 2023, 2:03pm UTC](https://forum.mautic.org/t/custom-email-to-contact-does-not-import-from-existing-template/28315/3 "2023-06-14T14:03:28Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [June 16, 2023, 10:06am UTC](https://forum.mautic.org/t/custom-email-to-contact-does-not-import-from-existing-template/28315/4 "2023-06-16T10:06:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![johnhannawin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/johnhannawin/32/7859_2.png) [@johnhannawin](https://forum.mautic.org/u/johnhannawin)\
**Post date:** [July 19, 2023, 2:19pm UTC](https://forum.mautic.org/t/custom-email-to-contact-does-not-import-from-existing-template/28315/5 "2023-07-19T14:19:15Z")

</div>

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?

---

<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:** [July 19, 2023, 2:51pm UTC](https://forum.mautic.org/t/custom-email-to-contact-does-not-import-from-existing-template/28315/6 "2023-07-19T14:51:33Z")

</div>

Hi, here usually helps if you rebuild your assets.

`bin/console mautic:assets:generate`

This usually does the job in this case.

---

<div class="post-metadata">

**Author:** ![johnhannawin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/johnhannawin/32/7859_2.png) [@johnhannawin](https://forum.mautic.org/u/johnhannawin)\
**Post date:** [July 19, 2023, 3:02pm UTC](https://forum.mautic.org/t/custom-email-to-contact-does-not-import-from-existing-template/28315/7 "2023-07-19T15:02:10Z")

</div>

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?

---

<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:** [July 19, 2023, 4:13pm UTC](https://forum.mautic.org/t/custom-email-to-contact-does-not-import-from-existing-template/28315/8 "2023-07-19T16:13:59Z")

</div>

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