Mautic Community Forums

Unable to send HTML email: PHP Warning

Hi there. New to mautic. Trying to send a custom css/html email created in-house and get the below, copied via the log. FYI, the email displays fine in the public preview URL.



[2016-02-12 17:56:07] mautic.WARNING: PHP Warning: Invalid argument supplied for foreach() - in file /opt/bitnami/apps/mautic/htdocs/app/bundles/CoreBundle/Templating/Helper/FormatterHelper.php - at line 56 []



Thank you for any assistance.



Best, DJ.

Hi there. New to mautic. Trying to send a custom css/html email created in-house and get the below, copied via the log. FYI, the email displays fine in the public preview URL.

[2016-02-12 17:56:07] mautic.WARNING: PHP Warning: Invalid argument supplied for foreach() - in file /opt/bitnami/apps/mautic/htdocs/app/bundles/CoreBundle/Templating/Helper/FormatterHelper.php - at line 56 []

Thank you for any assistance.

Best, DJ.

Thanks for the reply.

We already have a custom html/css mailer we send via our former mail provider - mail chimp. The template is a single file with css in header and inline css within the html table structure. Steps to reproduce:

  1. In Email we created a new template for list? and selected “none” template.
  2. We pasted the entire CSS/HTML in line into the source block of the WYSIWYG.
  3. The WYSIWYG preview looked good, so we uploaded a sample list and scheduled the email to send to the sample list.
  4. We manually ran the cron jobs to update the campaign and send the email to the sample (test) list.
  5. When the job kicked off and tried to send the email through our SMTP server, we got these errors in mautic.

I looked at the code. The problematic line is here:

https://github.com/mautic/mautic/blob/staging/app/bundles/CoreBundle/Templating/Helper/FormatterHelper.php#L56

This FormatterHelper is used (if I didn’t overlooked anything) only in the Report Bundle. Not in the Email Bundle. I also cannot reproduce it anyhow. Could you test if it happens with another, simpler email? Maybe it’s caused by the email content and in that case, we’ll need it to fix it.

Could you provide the steps to replicate this warning?