Need to include form selections in confirmation email and change the name of the fields | Community
Skip to main content
Ben_Cooper
New Participant
January 8, 2018
Solved

Need to include form selections in confirmation email and change the name of the fields

  • January 8, 2018
  • 3 replies
  • 4480 views

We've created a form to use as an RSVP for a Conference inside Marketo. We have built boolean fields that users will check on the landing page depending on which events they want to attend at the conference. The actual field names are shorter than what the user will see and select on the landing page where the form is embedded. The user can choose more than one selection. We would like to send a follow up email after the user has submitted the form with his/her selections. I am trying to figure out how to do the following:

  1. In the body of the follow up email, how to show only the selections that the user chose in the form. E.g. You have been confirmed for selections 1, 3, & 7. Would this be a token maybe?
  2. If this is a token of some type, not to use the field name, but somehow be able to translate the field name into something that is readable to the user. e.g. field name is cool event, the user will see it as Cool Event at 10am, Booth #123, in the body of the email.
Best answer by SanfordWhiteman

Yep, as predicted by JD, I would do this in Velocity.

## Database field names go on the left, user-friendly names on the right

#set( $booleanFriendlies = {

  "Whitebean__c" : "White Bean Hummus",

  "Cashew_sicle_1" : "Cashew Creamsicle",

  "Pobofu" : "Tofu Po'boy"

})

Your favorite foods are:

#foreach( $fieldin $booleanFriendlies.keySet() )

#if( $lead[$field] == "1" )

$booleanFriendlies[$field]##

#end

#end

This outputs the friendly name for any field that's true.

3 replies

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
January 9, 2018

Yep, as predicted by JD, I would do this in Velocity.

## Database field names go on the left, user-friendly names on the right

#set( $booleanFriendlies = {

  "Whitebean__c" : "White Bean Hummus",

  "Cashew_sicle_1" : "Cashew Creamsicle",

  "Pobofu" : "Tofu Po'boy"

})

Your favorite foods are:

#foreach( $fieldin $booleanFriendlies.keySet() )

#if( $lead[$field] == "1" )

$booleanFriendlies[$field]##

#end

#end

This outputs the friendly name for any field that's true.

Ben_Cooper
New Participant
January 9, 2018

Hi Sanford,

After changing the variables in your script to match mine, do I just add this to an email script token in Marketo?

SanfordWhiteman
New Participant
January 9, 2018

Right. And make sure to check off all the fields you're using in the tree on the right-hand-side of Script Editor.

keithnyberg
New Participant
January 8, 2018

Hey Ben,

For #2, you can name the fields anything you want in the email body, it's only the token needs to reference the system field name. Another solution to problem #1 is to list all the options in the body of the email with the boolean token for the response next to the values. This will show your default value if empty ("not selected" or whatever you define) or a 1 for True responses, just need to tell the users that 1 = True. See screenshot from Josh Hills MRSG Email preference center. Not as sleek, but it works.

Community Manager
January 8, 2018

I did something similar, although not with events, using segmentation. If you're looking to combine topics into one sentence, then I'm sure Sanford will have some velocity scripting for you to do. However, all I did was have a trigger watch for the form, then add each user to a segmentation. Then in my email I had as many segmentation fields as I did topics, and the email would only show those that were applicable to that person.

If you can group them that way, it's a pretty easy way to set it up. If this needs to be scalable, then this isn't the answer (you only get a set # of segmentations and you have to set them each up manually).

But -- for those of us not capable of velocity or anything like that, it worked for me.

Note of caution - make sure your email doesn't send immediately and you allow time for your segmentations to update -- test thoroughly.