# How to use an existed dynamic content in emails

**URL:** <https://forum.mautic.org/t/how-to-use-an-existed-dynamic-content-in-emails/27482>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [March 23, 2023, 1:13pm UTC](https://forum.mautic.org/t/how-to-use-an-existed-dynamic-content-in-emails/27482 "2023-03-23T13:13:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ooralas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ooralas/32/7060_2.png) [@ooralas](https://forum.mautic.org/u/ooralas)\
**Post date:** [March 23, 2023, 1:13pm UTC](https://forum.mautic.org/t/how-to-use-an-existed-dynamic-content-in-emails/27482/1 "2023-03-23T13:13:14Z")

</div>

**Your software**  
My Mautic version is: 4.4.7  
My PHP version is: 8.0.25  
My Database type and version is:10.6.12-MariaDB-0ubuntu0.22.04.1

I have created a DWC element that I want to use in a mail template. How can I retrieve this already existing element in the mail ?  
I use MJML for the mails, and have a GrapesJS builder.

I have tried to retrieve the dynamic content through this element:

```auto
<mj-text data-gjs-type="dynamic-content" data-slot="slotname" data-param-dec-id="2">Dynamic Content 2</mj-text>

```

But it does not work.  
i have also tried this:

```auto
{dwc=slotname}

```

But it does not work.

---

<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:** [March 23, 2023, 2:19pm UTC](https://forum.mautic.org/t/how-to-use-an-existed-dynamic-content-in-emails/27482/2 "2023-03-23T14:19:11Z")

</div>

Hi, DWC means Dynamic Web content.  
You can’t use it in emails.  
You need to use Dynamic Email Content.  
In code mode:

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

Or through the GUI.

---

<div class="post-metadata">

**Author:** ![ooralas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ooralas/32/7060_2.png) [@ooralas](https://forum.mautic.org/u/ooralas)\
**Post date:** [March 23, 2023, 2:29pm UTC](https://forum.mautic.org/t/how-to-use-an-existed-dynamic-content-in-emails/27482/3 "2023-03-23T14:29:20Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/5a1ab1c7267af80f2476c75508b00b8b4a0b5dd7.png)  
do you mean that ?  
but so I have to build the DEC individually for each mail ?

---

<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:** [March 23, 2023, 2:31pm UTC](https://forum.mautic.org/t/how-to-use-an-existed-dynamic-content-in-emails/27482/4 "2023-03-23T14:31:32Z")

</div>

There are many ways you can do this. I’m not sure what is inside of your dyn content.

Maybe look at this plugin:  
[https://github.com/Logicify/mautic-advanced-templates-bundle](https://github.com/Logicify/mautic-advanced-templates-bundle)

---

<div class="post-metadata">

**Author:** ![ooralas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ooralas/32/7060_2.png) [@ooralas](https://forum.mautic.org/u/ooralas)\
**Post date:** [March 23, 2023, 2:35pm UTC](https://forum.mautic.org/t/how-to-use-an-existed-dynamic-content-in-emails/27482/5 "2023-03-23T14:35:18Z")

</div>

i want to implement salutation for the mails. I have a contactfield “Salutation” and then conditional to this field i should be Hello Mr. or Hello Ms.  
which way will work with MJML?

---

<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:** [March 23, 2023, 5:14pm UTC](https://forum.mautic.org/t/how-to-use-an-existed-dynamic-content-in-emails/27482/6 "2023-03-23T17:14:18Z")

</div>

I’m not sure what are you asking “which way”  
You can set:  
If Salutation is “Mr”, then use this dyn content, if it’s “Ms” use the other one.

---

<div class="post-metadata">

**Author:** ![ooralas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ooralas/32/7060_2.png) [@ooralas](https://forum.mautic.org/u/ooralas)\
**Post date:** [March 24, 2023, 7:52am UTC](https://forum.mautic.org/t/how-to-use-an-existed-dynamic-content-in-emails/27482/7 "2023-03-24T07:52:41Z")

</div>

> [@joeyk](#):
>
> There are many ways you can do this

because of your comments up there, I asked which way. I would like to know if it is somehow possible to store the logic for salutation in a central place, and reference to it in each mail to this DC somehow. So a kind of reuse.

---

<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:** [March 24, 2023, 8:21am UTC](https://forum.mautic.org/t/how-to-use-an-existed-dynamic-content-in-emails/27482/8 "2023-03-24T08:21:28Z")

</div>

Okay, I figured you read the documentation of the plugin I mentioned above: [https://github.com/Logicify/mautic-advanced-templates-bundle](https://github.com/Logicify/mautic-advanced-templates-bundle)

Or this article mentioning another great plugin:

> **[Mautic and the Beauty of the Deutsche Sprache – Joey Keller](https://joeykeller.com/mautic-and-the-beauty-of-the-deutsche-sprache/)**

It is there exactly how you can use a generic salutation.

---

<div class="post-metadata">

**Author:** ![ooralas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ooralas/32/7060_2.png) [@ooralas](https://forum.mautic.org/u/ooralas)\
**Post date:** [March 24, 2023, 8:26am UTC](https://forum.mautic.org/t/how-to-use-an-existed-dynamic-content-in-emails/27482/9 "2023-03-24T08:26:56Z")

</div>

okay thanks a lot.  
Can you please tell me bevor i install the plug in if it is compatible with MJML and GrapesJS Builder for MJML?  
Here where i work, to install a plug-in for Mautic it is not so easy, because some steps have to be done before the plugin can be installed.

---

<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:** [March 24, 2023, 8:51am UTC](https://forum.mautic.org/t/how-to-use-an-existed-dynamic-content-in-emails/27482/10 "2023-03-24T08:51:29Z")

</div>

I see.  
I personally tested this one and use it on over 80 installations with grapejs  
[https://mtcextendee.com/marketplace/twig-templates-for-mautic/](https://mtcextendee.com/marketplace/twig-templates-for-mautic/)

The other one is recently forked, I haven’t tested yet, but I think it is compatible.
