Dynamic Content in email sent from campaign is not replaced

Your software
My Mautic version is: 4.4.1
My PHP version is: 7.4.29
My Database type and version is: 10.3.34-MariaDB-0ubuntu0.20.04.1

Your problem
My problem is:
Dynamic content is not being replaced.

Email (using classic-editor and personalized theme based on the blank-theme):

Dynamic Content:

Email is sent from a campaign to my test segment.
On email client the email is looking like this - nothing was replaced:
image

These errors are showing in the log:

[2022-11-12 17:30:52] mautic.NOTICE: PHP Notice - Trying to access array offset on value of type bool - in file /var/www/html/m/app/bundles/CoreBundle/Controller/ExceptionController.php - at line 111 {"request":"[object] (Symfony\\Component\\HttpFoundation\\Request: GET ///remote/fgt_lang?lang=/../../../..//////////dev/ HTTP/1.1\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive\r\nHost: 88.99.225.124\r\nUser-Agent: python-requests/2.6.0 CPython/2.7.5 Linux/3.10.0-1160.el7.x86_64\r\nX-Php-Ob-Level: 1\r\n\r\n)","exception":"[object] (Symfony\\Component\\Debug\\Exception\\FlattenException: {})","logger":null,"class":"Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException","currentContent":"","layout":"Error","code":404,"anonymous":true,"baseTemplate":"MauticCoreBundle:Default:slim.html.php","templatePage":false,"template":"MauticCoreBundle:Error:404.html.php","templating":"[object] (Symfony\\Bundle\\FrameworkBundle\\Templating\\DelegatingEngine: {})","statusText":"Not Found","url":"///remote/fgt_lang?lang=/../../../..//////////dev/","urlParts":false} {"hostname":"ubuntu-2gb-nbg1-1","pid":1588665}

[2022-11-12 17:40:39] mautic.NOTICE: PHP Notice - Trying to access array offset on value of type bool - in file /var/www/html/m/app/bundles/PageBundle/Entity/HitRepository.php - at line 267 {"options":{"leadId":"903","0":"https://ionutojica.com/%","second_to_last":"4192"},"sq":"[object] (Doctrine\\DBAL\\Query\\QueryBuilder: SELECT h.date_hit latest_hit FROM page_hits h WHERE (h.lead_id = 903) AND (h.id <> 4192))","result":false} {"hostname":"ubuntu-2gb-nbg1-1","pid":1597483}

[2022-11-12 17:41:44] mautic.NOTICE: PHP Notice - Trying to access array offset on value of type bool - in file /var/www/html/m/app/bundles/PageBundle/Entity/HitRepository.php - at line 267 {"options":{"leadId":"904","0":"https://ionutojica.com/%","second_to_last":"4194"},"sq":"[object] (Doctrine\\DBAL\\Query\\QueryBuilder: SELECT h.date_hit latest_hit FROM page_hits h WHERE (h.lead_id = 904) AND (h.id <> 4194))","result":false} {"hostname":"ubuntu-2gb-nbg1-1","pid":1592632}

Steps I have tried to fix the problem:

  1. as shown above, tried with all sort of short_code
  2. search on mautic forum and found unsolved issues, based on V2, V3, and V4.1 :

2021 V4, but not the type of dynamic content I would like: Send Mail with Dynamic Content on Contact Screen does not work
2021 V3, but used in code-mode, which I do not use: Dynamic content at Code Mode in Emails - how?
2020 V2: Dynamic Content in Email Issues
2018: Dynamic content placeholder in email is not replaced

  1. would it be, that I can use the dynamic content ID-number (in my case: 4) ? I will try it also

  2. updating to 4.4.4 would help?
    I just saw this BUG closed in April 2022: Multiple areas of Mautic throw a 500 error · Issue #9762 · mautic/mautic · GitHub . So I will try to update mautic.
    Later edit: I updated to 4.4.4 => no improvement. I suppose I do not use the dynamic content correctly…

  3. found a good description of dynamic content functionality here: Content Personalisation in Mautic - Tutorial on Mautic Dynamic Content | Droptica . But still not working.

I am thankful for any advice. I would be open to try find out by myself inside the code, what the error could be, but I would need some direction, in which file should I search…

Regards,
Ionut

Hello, I just read your post quickly, but my first comment is, that DWC means Dynamic Web Content and it cannot be usen in Emails. You can add dynamic content in emails, but better use the gui for that.

Joey

Thank you for your reply. What do you mean:

better use gui for that.

Ok, what do I want to achieve: I want to have the same piece of content in more emails. To have only one place where I will change this piece of content, and all further sent emails will adapt.

I guess this might be some miss interpretion. Dynamic content for the email will be defined within the email itself - the dynamic content section will be edited within the mail.

You seem to be looking for some kind of “content shortcode” which will be centrally be managed and be injected instead of the short code in any of the mails? That would be a nice thing, but is not available afaik. Would be possible with a custom plugin though.

Actually Twig templates plugin does just that.

1 Like

Is that for legacy and grapeJS?

Works everywhere