# Custom shortcode

**URL:** <https://forum.mautic.org/t/custom-shortcode/23023>\
**Category:** Ideas and Feature Requests\
**Created:** [March 12, 2022, 11:11am UTC](https://forum.mautic.org/t/custom-shortcode/23023 "2022-03-12T11:11:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev570](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dev570/32/6984_2.png) [@dev570](https://forum.mautic.org/u/dev570)\
**Post date:** [March 12, 2022, 11:11am UTC](https://forum.mautic.org/t/custom-shortcode/23023/1 "2022-03-12T11:11:17Z")

</div>

My idea is:  
Create custom shortcodes for email. We already have the signature shortcode, but it would be nice to have more shortcodes we can use in emails.

---

<div class="post-metadata">

**Author:** ![pierre\_a](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pierre_a/32/7031_2.png) [@pierre\_a](https://forum.mautic.org/u/pierre_a)\
**Post date:** [March 12, 2022, 8:31pm UTC](https://forum.mautic.org/t/custom-shortcode/23023/2 "2022-03-12T20:31:40Z")

</div>

Hello @dev570,

Can you give us some examples of shortcodes that you imagine and their concrete use cases?

Pierre

---

<div class="post-metadata">

**Author:** ![dev570](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dev570/32/6984_2.png) [@dev570](https://forum.mautic.org/u/dev570)\
**Post date:** [March 14, 2022, 10:00am UTC](https://forum.mautic.org/t/custom-shortcode/23023/3 "2022-03-14T10:00:59Z")

</div>

Hi @pierre_a,

Here are some examples:

- We have an about us text that is used in many emails and automations, it would be very handy to change this text globally using a shortcode.
- We also use emails as a reply and refer to the old email below that email. In this case it would be handy to do this by shortcode as well because else we have to change all the emails.
- Or for example a disclaimer text or other legal text or repeating text.

It could be a submenu of channels that is called “shortcodes” for example. The shortcode can be used in emails, but maybe later in other channels as well.

Kind regards,  
Dev570

---

<div class="post-metadata">

**Author:** ![dev570](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dev570/32/6984_2.png) [@dev570](https://forum.mautic.org/u/dev570)\
**Post date:** [March 14, 2022, 10:04am UTC](https://forum.mautic.org/t/custom-shortcode/23023/4 "2022-03-14T10:04:57Z")

</div>

I think it is called a variable in Mautic and would be the creating of custom global variables.

> **[Variables | Mautic](https://docs.mautic.org/en/setup/variables)**
>
> . . Contact fields. Company Contact fields. Mautic Component tokens. Email specific tokens. Landing Page tokens. . Preference Center Landing Page tokens. . Dynamic Web Content tokens. Contact Monitoring. Search filters. Alphabetical list. . . ProTip....

---

<div class="post-metadata">

**Author:** ![pierre\_a](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pierre_a/32/7031_2.png) [@pierre\_a](https://forum.mautic.org/u/pierre_a)\
**Post date:** [March 14, 2022, 6:37pm UTC](https://forum.mautic.org/t/custom-shortcode/23023/5 "2022-03-14T18:37:26Z")

</div>

Hello @dev570,

Thanks for your answer.  
I read your example, on my side I use “Mautic template” for this use case.  
Do you try to use template?

Pierre

---

<div class="post-metadata">

**Author:** ![dev570](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dev570/32/6984_2.png) [@dev570](https://forum.mautic.org/u/dev570)\
**Post date:** [March 15, 2022, 9:39am UTC](https://forum.mautic.org/t/custom-shortcode/23023/6 "2022-03-15T09:39:12Z")

</div>

Hello @pierre_a,

Do you mean a normal Mautic email template?  
What do you mean with “Mautic template”, can you point me to the documentation about it?  
Or do you mean hard code the text into a template and use that? I still would prefer to have this shortcode option as a feature request.

Kind regards,  
dev570

---

<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 15, 2022, 1:06pm UTC](https://forum.mautic.org/t/custom-shortcode/23023/7 "2022-03-15T13:06:35Z")

</div>

Hi, you could use this:

> **[Twig Templates for Mautic](https://mtcextendee.com/marketplace/twig-templates-for-mautic/)**
>
> Buy now one domain license / 39€ – buy nowunlimited license / 169€ – buy now Buy now one domain license / 39€ – buy nowunlimited license / 169€ – buy now

Cannot get more flexible then that.

---

<div class="post-metadata">

**Author:** ![pierre\_a](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pierre_a/32/7031_2.png) [@pierre\_a](https://forum.mautic.org/u/pierre_a)\
**Post date:** [March 15, 2022, 3:04pm UTC](https://forum.mautic.org/t/custom-shortcode/23023/8 "2022-03-15T15:04:30Z")

</div>

Hello @dev570,

You can follow this tutorial:

> **[Building a Theme, Step by Step](https://www.mautic.org/building-a-theme-step-by-step)**
>
> Building your first theme
> Mautic offers a lot of flexibility when it comes to creating themes.As you learn more, you will be able to harness more and more of the benefits of custom themes.
> Follow this guide to create a theme for a landing page,...

Pierre

---

<div class="post-metadata">

**Author:** ![dev570](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dev570/32/6984_2.png) [@dev570](https://forum.mautic.org/u/dev570)\
**Post date:** [March 17, 2022, 10:53am UTC](https://forum.mautic.org/t/custom-shortcode/23023/9 "2022-03-17T10:53:49Z")

</div>

I bought this and works great, thanks!
