{"id":6299,"date":"2022-03-29T17:05:07","date_gmt":"2022-03-29T15:05:07","guid":{"rendered":"https:\/\/aivie.ch\/faq\/how-do-i-create-dynamic-content-in-mautic\/"},"modified":"2024-12-19T19:06:55","modified_gmt":"2024-12-19T17:06:55","slug":"how-do-i-create-dynamic-content-in-mautic","status":"publish","type":"faq","link":"https:\/\/aivie.ch\/en\/faq\/how-do-i-create-dynamic-content-in-mautic\/","title":{"rendered":"How do I create dynamic content in Aivie \/ Mautic?"},"content":{"rendered":"\n<p>With reusable dynamic content, you can create content once and then reuse it in different emails. Both static content and dynamic content. <\/p>\n\n<!--more-->\n\n<h2 class=\"wp-block-heading\">How can I create dynamic content?<\/h2>\n\n<p>You can use the full power of <a href=\"https:\/\/twig.symfony.com\/doc\/3.x\/templates.html#control-structure\" target=\"_blank\" rel=\"noopener\">TWIG<\/a> here. <\/p>\n\n<p>Here we show you some examples:<\/p>\n\n<h3 class=\"wp-block-heading\">Formulate the address differently according to gender<\/h3>\n\n<pre class=\"wp-block-code\"><code>&lt;!--{% if contactfield.gender == 'Female' %}-->\nSehr geehrte Frau {{contactfield.lastname}}\n&lt;!--{% elseif contactfield.gender == 'Male' %}-->\nSehr geehrter Herr {{contactfield.lastname}}\n&lt;!--{% else %}\nGuten Tag {{contactfield.firstname}} {{contactfield.lastname}}\n&lt;!--{% endif %}-->\n<\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">Display different content depending on the segment<\/h3>\n\n<pre class=\"wp-block-code\"><code>&lt;!-- {% if 'Interested in A' in contactfield.segments %} -->\n&lt;a href=\"#\">Link A&lt;\/a>\n&lt;!-- {% elseif 'Interested in B' in contactfield.segments %} -->\n&lt;a href=\"#\">Link B&lt;\/a>\n&lt;!-- {% else %} -->\n&lt;a href=\"#\">Link default&lt;\/a>\n&lt;!-- {% endif %} --><\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">Display different content depending on the tags assigned<\/h3>\n\n<pre class=\"wp-block-code\"><code>&lt;!--{% if 'verified-email' in contactfield.tags %}-->\nYou are verified\n&lt;!--{% else %}-->\nYou need to verify\n&lt;!--{% endif %}--><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">How can I use dynamic content in emails?<\/h2>\n\n<p>You can then <a href=\"https:\/\/aivie.ch\/en\/faq\/how-do-i-use-dynamic-content-reusable-content\/?preview_id=5067&amp;preview_nonce=dec24d2d74&amp;_thumbnail_id=-1&amp;preview=true\">use<\/a> this <a href=\"https:\/\/aivie.ch\/en\/faq\/how-do-i-use-dynamic-content-reusable-content\/?preview_id=5067&amp;preview_nonce=dec24d2d74&amp;_thumbnail_id=-1&amp;preview=true\">dynamic content directly in the email builder<\/a>. Simply drag and drop the block onto the canvas and select the appropriate element.<\/p>\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>With reusable dynamic content, you can create content once and then reuse it in different emails. Both static content and dynamic content.<\/p>\n","protected":false},"featured_media":0,"template":"","categories":[],"tags":[],"FaqCategories":[281],"FaqTags":[312,313],"class_list":["post-6299","faq","type-faq","status-publish","hentry","FaqCategories-emails","FaqTags-dynamic-contents","FaqTags-reusable-content-en"],"acf":[],"featured_image_urls_v2":{"full":"","thumbnail":"","medium":"","medium_large":"","large":"","post-thumbnail":"","aiv_480w":"","woocommerce_thumbnail":"","woocommerce_single":"","woocommerce_gallery_thumbnail":""},"post_excerpt_stackable_v2":"<p>With reusable dynamic content, you can create content once and then reuse it in different emails. Both static content and dynamic content. How can I create dynamic content? You can use the full power of TWIG here. Here we show you some examples: Formulate the address differently according to gender &lt;!&#8211;{% if contactfield.gender == &#8216;Female&#8217; %}&#8211;> Sehr geehrte Frau {{contactfield.lastname}} &lt;!&#8211;{% elseif contactfield.gender == &#8216;Male&#8217; %}&#8211;> Sehr geehrter Herr {{contactfield.lastname}} &lt;!&#8211;{% else %} Guten Tag {{contactfield.firstname}} {{contactfield.lastname}} &lt;!&#8211;{% endif %}&#8211;> Display different content depending on the segment &lt;!&#8211; {% if &#8216;Interested in A&#8217; in contactfield.segments %} &#8211;> &lt;a href=&#8221;#&#8221;>Link A&lt;\/a>&hellip;<\/p>\n","category_list_v2":"Uncategorized","author_info_v2":{"name":"","url":""},"comments_num_v2":"0 comments","_links":{"self":[{"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/faq\/6299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/types\/faq"}],"version-history":[{"count":2,"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/faq\/6299\/revisions"}],"predecessor-version":[{"id":21723,"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/faq\/6299\/revisions\/21723"}],"wp:attachment":[{"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/media?parent=6299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/categories?post=6299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/tags?post=6299"},{"taxonomy":"FaqCategories","embeddable":true,"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/FaqCategories?post=6299"},{"taxonomy":"FaqTags","embeddable":true,"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/FaqTags?post=6299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}