Custom Field Name in Email

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

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:

{% 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']) }}

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

Hi, you can use Text area field type, that is longer:
image

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

Sorry I was blind… I just found the option…

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

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.