Email Sending Error: Substitutions are limited to 10000 bytes per personalization block

Your software
My Mautic version is: 2.14.1
My PHP version is: 7.1.33

Your problem
My problem is: I have been sending email out from Mautic via API w/my email provider SendGrid for approx. 2 years with no issues, same Mautic install, same cfg. All of a sudden today when trying to send, I’m getting a 400 error back from SendGrid: [MAIL ERROR] Substitutions are limited to 10000 bytes per personalization block. I copied the email from one I sent previously and modified it with new content but otherwise didn’t make any significant changes.

SendGrid is saying they need the JSON request/payload that Mautic is sending, which should include an X-SMTPAPI header that will include the substitutions. How do I get the JSON request so I can send to them for analysis or how do I determine the culprit?

These errors are showing in the log: [MAIL ERROR] Substitutions are limited to 10000 bytes per personalization

Steps I have tried to fix the problem: Sorry, don’t know what to do

Thank you!

My Mautic version is: 2.12.0
My PHP version is: 7.1.30

I am using sendgrid API for sending emails. But, Mautic is not sending email due to some limitation from Sendgrid.

I want to send 50K emails day and 3 emails a week

Here is the log file status from mautic

[2020-06-03 20:05:02] mautic.ERROR: SendGrid response: 400 {“response”:"[object] (SendGrid\Response: {})"}

[2020-06-03 20:05:02] mautic.ERROR: [MAIL ERROR] Substitutions are limited to 10000 bytes per personalization block. (send); Email Addresses Removed {“exception”:"[object] (Swift_TransportException(code: 0): Substitutions are limited to 10000 bytes per personalization block. at /opt/bitnami/apps/mautic/htdocs/app/bundles/EmailBundle/Swiftmailer/SendGrid/SendGridApiFacade.php:61)"}

[2020-06-03 20:05:02] mautic.ERROR: SendGrid response: 400 {“response”:"[object] (SendGrid\Response: {})"}

[2020-06-03 20:05:02] mautic.ERROR: [MAIL ERROR] Substitutions are limited to 10000 bytes per personalization block. (send); {“exception”:"[object] (Swift_TransportException(code: 0): Substitutions are limited to 10000 bytes per personalization block. at /opt/bitnami/apps/mautic/htdocs/app/bundles/EmailBundle/Swiftmailer/SendGrid/SendGridApiFacade.php:61)"}

[2020-06-03 20:22:22] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: The “–force” option does not exist. (uncaught exception) at /opt/bitnami/apps/mautic/htdocs/vendor/symfony/console/Input/ArgvInput.php line 217 while running console command mautic:email:fetch

[2020-06-03 20:22:37] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /opt/bitnami/apps/mautic/htdocs/vendor/symfony/console/Input/ArgvInput.php line 182 while running console command mautic:email:fetch

These are the cron jobs

10-59/20 * * * * su daemon -s /bin/sh -c “/opt/bitnami/php/bin/php -q /opt/bitnami/apps/mautic/htdocs/app/console mautic:segments:update”
5-59/20 * * * * su daemon -s /bin/sh -c “/opt/bitnami/php/bin/php -q /opt/bitnami/apps/mautic/htdocs/app/console mautic:campaigns:update”
10,25,40,55 * * * * su daemon -s /bin/sh -c “/opt/bitnami/php/bin/php -q /opt/bitnami/apps/mautic/htdocs/app/console mautic:campaigns:trigger”
15-59/20 * * * * su daemon -s /bin/sh -c “/opt/bitnami/php/bin/php -q /opt/bitnami/apps/mautic/htdocs/app/console mautic:campaigns:rebuild”

Hi there,

Firstly, you are on a very outdated version of Mautic (2.16.2 is the current stable release in the 2.x series), so if there were any fixes you would need to update.

Please plan to update your instance (in a test area first, with backups etc!) at your earliest convenience.

The error you are seeing seems to be specific to Sendgrid - https://sendgrid.com/docs/for-developers/sending-email/substitution-tags/ so I would recommend reaching out to their support team.

Perhaps also check for overly long/personalised subject lines?

I found an existing post with the same question so will merge them to avoid duplication.