# Custom Field Name in Email

**URL:** <https://forum.mautic.org/t/custom-field-name-in-email/20625>\
**Category:** Product Support\
**Created:** [August 28, 2021, 11:47am UTC](https://forum.mautic.org/t/custom-field-name-in-email/20625 "2021-08-28T11:47:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![niralmodi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/niralmodi/32/4479_2.png) [@niralmodi](https://forum.mautic.org/u/niralmodi)\
**Post date:** [August 28, 2021, 11:47am UTC](https://forum.mautic.org/t/custom-field-name-in-email/20625/1 "2021-08-28T11:47:27Z")

</div>

**Your software**  
My Mautic version is:3.3  
My PHP version is: 7.4.22

**Your problem**  
My problem is: i have a site which has 50 courses which we have set up as custom fields.  
Our use case is that when a user enrolls in a specific course we want to start a drip to motivate him to complete a course. In the email we want to say Hi XYZ, Welcome to ABC Course on LearnVern where the abc course name would be 1 of 50 that he has enrolled for

How do I call out the course name without changing the email template with hard coded course name for each course.

I am able to use custom first name. But as each user might have multiple courses for which they have enrolled. How do I send a welcome email with Fname and Custom Field Course Name.

Thanks in advance

---

<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:** [August 29, 2021, 9:47am UTC](https://forum.mautic.org/t/custom-field-name-in-email/20625/2 "2021-08-29T09:47:33Z")

</div>

Hi, the course name is random from the list?

> abc course name would be 1 of 50 that he has enrolled for

Can you save a custom field in Json where you save all active courses?  
This would make your life a lot easier and enable automation.

Format:

```auto
{% set courses = formresult.json | json_decode %}
{% for course in courses %}
{{course.name}}
{% endfor %} (edited)

```

If yes, you can use the Twig plugin to show randomised content.

Format:  
`{{ random(['apple', 'orange', 'citrus']) }}`

---

<div class="post-metadata">

**Author:** ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)\
**Post date:** [August 22, 2022, 7:59am UTC](https://forum.mautic.org/t/custom-field-name-in-email/20625/3 "2022-08-22T07:59:18Z")

</div>

Hi Joey,

i have a short question about saving json data in a contact:

How can I define a custom field to save json? Is it just a custom field with type “text”?

Because when I try to save data in this field (via ui/form) I got the validation error that max 191 chars can be saved. But 191 is to less for our json data.

Is there a way to save longer text (or explicit json) to a custom field?

Best regards,

Timo

---

<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:** [August 22, 2022, 8:37am UTC](https://forum.mautic.org/t/custom-field-name-in-email/20625/4 "2022-08-22T08:37:26Z")

</div>

Hi, you can use Text area field type, that is longer:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/6ea1da61ad3ed37d94dba79489e5ebbcf7a05de8.png)

---

<div class="post-metadata">

**Author:** ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)\
**Post date:** [August 22, 2022, 9:39am UTC](https://forum.mautic.org/t/custom-field-name-in-email/20625/5 "2022-08-22T09:39:41Z")

</div>

Hi Joey,

thanks for your quick reply!

Sorry I didn’t see the “allow html” switch in custom field configuration.

Is this a new feature in mautic? We currently use version 4.3.1.

Best regards,

Timo

---

<div class="post-metadata">

**Author:** ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)\
**Post date:** [August 22, 2022, 9:51am UTC](https://forum.mautic.org/t/custom-field-name-in-email/20625/6 "2022-08-22T09:51:50Z")

</div>

Sorry I was blind… I just found the option…

---

<div class="post-metadata">

**Author:** ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)\
**Post date:** [August 22, 2022, 10:50am UTC](https://forum.mautic.org/t/custom-field-name-in-email/20625/7 "2022-08-22T10:50:21Z")

</div>

Hi Joey,

I have one more question about this:

Do you ever handled links in twig templates?

It seems that utm tracking parameter from the email are not added to the links inside a twig template.

Do you have experiences with this?

Best regards,

Timo

---

<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:** [August 22, 2022, 11:21am UTC](https://forum.mautic.org/t/custom-field-name-in-email/20625/8 "2022-08-22T11:21:54Z")

</div>

Hi, This particular case with UTM tracking I don’t remember using. If you wanna have a call where we check it out toegther, I’ll be happy to assist you.
