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.


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

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

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