Dynamic content at Code Mode in Emails - how?

Your software
My Mautic version is: 3.3.2
My PHP version is: 7.4.14
My Database type and version is:

Your problem
My problem is:

Dear Mautic community,
I would like to set up a email via code mode, but could not figure out how to include dynamic content. I tried inserting {dynamiccontent=“Dynamic Content 1”} - with a filled dynamic content with the same name, of course, but it does not show the appropriate content - when doing a live-sendout to a testing group. It shows “{dynamiccontent=“Dynamic Content 1”}”.

We did not upgrade to the GrapeJS based builder yet.

What do you recommend to do? I was already looking for tutorials and documentation - I am willing to read and learn - if there is a source out there touching this topic. :wink: Do we have to create email templates and use dynamic content that way? I would like to avoid this step, as the look & feel of the emails is still changing a lot.

Many thanks in advance!

I was also trying to use Dynamic Content (those under Components > Dynamic Content) in e-mails, but without any success so far.

@mcflo any update on this? Or anyone else?

I am somehow doubting that this Dynamic Content is not intended to be used in e-mails, am I right?

Alternatively there is the Dynamic Content Block in the e-mail builder of course, but this type of Dynamic Content cannot be re-used in other e-mails or landing pages which is quite a limitation.

Hi @guentr

There are two types of dynamic content in Mautic. The one that you are speaking about under components is dynamic content that you can use inside a landing page or a website.

If you would like to use dynamic content inside an email, on the right hand side you will see the different types of modules you can pull into an email when inside builder. There is one called Dynamic content, you need to use this one and then you will be able to define as many variables as you wish.

Let me know how it goes.

Regards,

Mike

1 Like

Hi @guentr ,

my ‘challenge’ was that I wanted to use dynamic content for emails in code mode. In this case there is no module overview on the right hand side. I thought that I can somehow add it manually with some lines of code - without success yet.

I decided to create a theme, upload it and use it instead of code mode. As we change the look & feel of the mails very often the theme has to be updated every time. Time consuming (and maybe totally stupid), but it works - also with dynamic content. As @mikew was describing. When the theme is properly configured (drag&drop areas) you can add them via the right hand side. Works like a charm.

Best regards!