Menu Close

Twig Templates for Mautic

Buy now

  • one domain license / 39€buy now
  • unlimited license / 169€ buy now

Twig Templates for Mautic 3 and Mautic 2

Download link for Mautic 2 is included in the package in file mautic2-version.md.

Twig templates for Mautic. Define unlimited Twig Templates and add it to email or sms by token {twigtemplate=1}

Support

https://mtcextendee.com

Installation

Manual

  • Download last version
  • Unzip files to plugins/MauticTwigTemplatesBundle
  • Clear cache (app/cache/prod/)
  • Go to /s/plugins/reload
  • Enable TwigTemplates plugin

Usage

1, See new item on left menu Twig Templates:

2, Setup Twig Templates

3, You can use Twig syntax

For example:

{% if contact.firstname %}
<p>Hi {{ contact.firstname }},</p>
{% elseif  contact.lastname %}
<p>Hi {{ contact.lastname}},</p>
{% endif %} 

  1. You can test by test area bellow the edit form

500

  1. Then go to emails and use token in email builder or subject. Tokens also works with suggestion (press { and search)

{twigtemplate=1}

Aditional features

Contact's tags

{{ contact.tags }}

Allow use contact's tags in twig syntax. You can use Twig filter and parse data what do you want.

 [tags] => Array
        (
            [2] => Another tag,
            [32] => Test tag
        )

Contact's segments

{{ contact.segments }}

Allow use contact's segments with twig syntax. You can use Twig filter and parse data what do you want.

    [segments] => Array
        (
            [13] => Array
                (
                    [isPublished] => 1
                    [dateAdded] => DateTime Object
                        (
                            [date] => 2020-02-17 14:27:35.000000
                            [timezone_type] => 3
                            [timezone] => UTC
                        )

                    [createdBy] => 1
                    [createdByUser] => Admin1 User
                    [dateModified] => DateTime Object
                        (
                            [date] => 2020-02-17 14:28:15.000000
                            [timezone_type] => 3
                            [timezone] => UTC
                        )

                    [modifiedBy] => 1
                    [modifiedByUser] => Admin1 User
                    [checkedOut] =>
                    [checkedOutBy] =>
                    [checkedOutByUser] => Admin1 User
                    [id] => 13
                    [name] => Twig test
                    [description] =>
                    [alias] => twig-test
                    [filters] => Array
                        (
                            [0] => Array
                                (
                                    [object] => lead
                                    [glue] => and
                                    [field] => firstname
                                    [type] => text
                                    [filter] => Test1
                                    [display] =>
                                    [operator] => =
                                )

                            [1] => Array
                                (
                                    [glue] => or
                                    [field] => firstname
                                    [object] => lead
                                    [type] => text
                                    [filter] => Test2
                                    [display] =>
                                    [operator] => =
                                )

                        )

                    [isGlobal] => 1
                    [isPreferenceCenter] =>
                )
        )
)

Buy now

  • one domain license / 39€buy now
  • unlimited license / 169€ buy now