# Dynamic Content in email sent from campaign is not replaced

**URL:** https://forum.mautic.org/t/dynamic-content-in-email-sent-from-campaign-is-not-replaced/26058
**Category:** Product Support
**Tags:** mautic-4
**Created:** [November 12, 2022, 7:18pm UTC](https://forum.mautic.org/t/dynamic-content-in-email-sent-from-campaign-is-not-replaced/26058 "2022-11-12T19:18:18Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![IonutOjicaDe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ionutojicade/32/7383_2.png) [@IonutOjicaDe](https://forum.mautic.org/u/IonutOjicaDe)
#### Post date: [November 12, 2022, 7:18pm UTC](https://forum.mautic.org/t/dynamic-content-in-email-sent-from-campaign-is-not-replaced/26058/1 "2022-11-12T19:18:18Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/ea61c2246d02721d3a2be997f3bbee9727799ea0.png)

Dynamic Content:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/8/87c16f3abd607b4954ea24c22585c138882f2935.png)

Email is sent from a campaign to my test segment.  
On email client the email is looking like this - nothing was replaced:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/4/4c61768fbb6443cf6f301b5c2265f1e279264e9e.png)

**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](https://forum.mautic.org/t/send-mail-with-dynamic-content-on-contact-screen-does-not-work/22776)  
2021 V3, but used in code-mode, which I do not use: [Dynamic content at Code Mode in Emails - how?](https://forum.mautic.org/t/dynamic-content-at-code-mode-in-emails-how/19184)  
2020 V2: [Dynamic Content in Email Issues](https://forum.mautic.org/t/dynamic-content-in-email-issues/13808)  
2018: [Dynamic content placeholder in email is not replaced](https://forum.mautic.org/t/dynamic-content-placeholder-in-email-is-not-replaced/10702)

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](https://github.com/mautic/mautic/issues/9762) . 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](https://www.droptica.com/blog/content-personalisation-mautic-tutorial-mautic-dynamic-content/) . 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

---

<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: [November 14, 2022, 9:01am UTC](https://forum.mautic.org/t/dynamic-content-in-email-sent-from-campaign-is-not-replaced/26058/2 "2022-11-14T09:01:02Z")

</div>

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

---

<div class="post-metadata">

### Author: ![IonutOjicaDe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ionutojicade/32/7383_2.png) [@IonutOjicaDe](https://forum.mautic.org/u/IonutOjicaDe)
#### Post date: [November 14, 2022, 4:41pm UTC](https://forum.mautic.org/t/dynamic-content-in-email-sent-from-campaign-is-not-replaced/26058/3 "2022-11-14T16:41:00Z")

</div>

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.

---

<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: [November 19, 2022, 9:46pm UTC](https://forum.mautic.org/t/dynamic-content-in-email-sent-from-campaign-is-not-replaced/26058/4 "2022-11-19T21:46:17Z")

</div>

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.

---

<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: [November 19, 2022, 10:23pm UTC](https://forum.mautic.org/t/dynamic-content-in-email-sent-from-campaign-is-not-replaced/26058/5 "2022-11-19T22:23:59Z")

</div>

Actually Twig templates plugin does just that.

---

<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: [November 19, 2022, 10:29pm UTC](https://forum.mautic.org/t/dynamic-content-in-email-sent-from-campaign-is-not-replaced/26058/6 "2022-11-19T22:29:31Z")

</div>

Is that for legacy and grapeJS?

---

<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: [November 19, 2022, 10:46pm UTC](https://forum.mautic.org/t/dynamic-content-in-email-sent-from-campaign-is-not-replaced/26058/7 "2022-11-19T22:46:23Z")

</div>

Works everywhere
