SOLVED

Suppress default text in auto-response email

Go to solution
Casler_Nancy__N
Level 3

If a user fills out a form but does not select a checkbox in my form, is there a way to prevent that lack of response from being recorded in my response email? I have a token pulling a checkbox field from my form, but if you don't check it, the word "no" shows up in my confirmation email. Is there a way to prevent that?

Tags (1)
1 ACCEPTED SOLUTION
Casler_Nancy__N
Level 3

I tried to make this work, to no avail so far. The multi-checkbox field I'm trying to call is company.Comments. I modified your suggested script as follows, created an email script token, and pulled it into my response email. So far, nothing at all displays (neither my selected choices, nor the "You checked off..." text) after I fill out the form and receive the response email. Here's what I'm using:

#set( $singleInterests = $company.Comments.split(";") ) 

#if( $singleInterests.size() ) 

You checked off the following interests: 

#foreach( $singleInterest in $singleInterests ) 

${singleInterest} 

#end

#end

I'm not clear on how $singleInterest is being defined, as opposed to it's plural version. Am I missing something there, do you think?

You're right, this is heading into the category of programming

View solution in original post

14 REPLIES 14
SanfordWhiteman
Level 10 - Community Moderator

OK! This is a great fit for an Email Script token. Conditional output is easy to do:

#if( $lead.someBooleanField == "1" )

You answered "Yes" to this question.

#end

Casler_Nancy__N
Level 3

Is there a good article on how email scripts work? I found a couple of links to information, but both go to a dead end. I haven't done this before and am not a programmer. I basically have a list of separate checkbox fields (each a separate field), and if a person doesn't check one or more of the boxes, we don't want anything at all to get written to the email for the unchecked boxes (we need them to be separate fields so that they don't get written to the email as a semi-colon separated running list as you get with a single "checkboxes" field). Can a script hide an unchecked choice entirely in the email, so that there wouldn't be an extra line break for the checkbox answers where there is no response? This is not easy to describe!

SanfordWhiteman
Level 10 - Community Moderator

Is there a good article on how email scripts work? I found a couple of links to information, but both go to a dead end.

I have to recommend my posts on Velocity. They're pretty much the only 3rd-party info on Marketo & Velocity working together.

In fairness, they aren't aimed at a non-programmer who doesn't want to become a programmer of sorts.

(we need them to be separate fields so that they don't get written to the email as a semi-colon separated running list as you get with a single "checkboxes" field). Can a script hide an unchecked choice entirely in the email, so that there wouldn't be an extra line break for the checkbox answers where there is no response? This is not easy to describe!

You actually don't need to use individual fields, since Velocity can separate the semicolon-delimited lists easily into multiple values:

Take a multi-select field called multipleInterestField which could have values like:

     apple;pear

     orange

     orange;pear

You can display only the interests they've checked off like so:

#set( $singleInterests = $lead.multipleInterestField.split(";") )

#if( $singleInterests.size() )

You checked off the following interests:

#foreach( $singleInterest in $singleInterests )

${singleInterest}

#end

#end

And if they have no interests, nothing is displayed, not even the "You checked off..." title (because we check the size of the list first).

Casler_Nancy__N
Level 3

OK, thank you so much! I'm going to read your posts and see if I can figure out making it work on my project. Interesting that I used apple, pear, banana and grapes for my test choices

Casler_Nancy__N
Level 3

I tried to make this work, to no avail so far. The multi-checkbox field I'm trying to call is company.Comments. I modified your suggested script as follows, created an email script token, and pulled it into my response email. So far, nothing at all displays (neither my selected choices, nor the "You checked off..." text) after I fill out the form and receive the response email. Here's what I'm using:

#set( $singleInterests = $company.Comments.split(";") ) 

#if( $singleInterests.size() ) 

You checked off the following interests: 

#foreach( $singleInterest in $singleInterests ) 

${singleInterest} 

#end

#end

I'm not clear on how $singleInterest is being defined, as opposed to it's plural version. Am I missing something there, do you think?

You're right, this is heading into the category of programming

Casler_Nancy__N
Level 3

The way I was able to pull in responses from a checkboxes field is via the following script. In this situation, I'm sending links to documents uploaded to the design studio to users who choose them for a list of checkboxes in a form field (generically referred to here as "fieldname_here"):

#set( $singleInterests = $lead.fieldname_here.split(";") ) 

#if( $singleInterests.size() ) 

#foreach( $singleInterest in $singleInterests ) 

## ${singleInterest}

<a href="https://info.gepower.com/rs/232-DKG-508/images/${singleInterest}" style="color:#005eb8;">${singleInterest}</a><br>

#end

#end

To add a url around each of my checked responses, I added a line of code that prepends the beginning part of the url to each file name, which is pulled from the Stored Value in my list of values in my checkbox field. The script goes into an email script in my program tokens. I then added that email script token to my response email. The result is an email containing a nice list of links to the documents the user checks from the list of checkbox options on the form.

SanfordWhiteman
Level 10 - Community Moderator

OK, this should be the Correct answer.

SanfordWhiteman
Level 10 - Community Moderator

Did you check of Lead.Comments in the right-hand-side tree in the Email Script Editor? Have to do that for any property (i.e. lead field) to exist in Velocity.

Casler_Nancy__N
Level 3

So I'm still trying to get this to work. Does it matter how the checkboxes field I use is configured (text, string, etc.)? I still get absolutely no data from my checkbox choices to write to my response email after I submit. I've got my email token in my response email, and everything is named correctly. I did check off the appropriate lead.fieldname in the tree menu in the token setup, so that's not the problem.

Here's the current script I'm working with:

#set( $singleInterests = $lead.DP_OriginalWork_GE_MKTO.split(";") ) 

#if( $singleInterests.size() ) 

You checked off the following interests: 

#foreach( $singleInterest in $singleInterests ) 

${singleInterest} 

#end

#end

I'm just using any old text-type field for testing purposes. That "DP_OriginalWork_GE_MKTO" field is the exact name of my checkboxes field in my test form. I have a test LP set up and am filling out the form there.

Would Marketo support have the know-how to be able to help me with Velocity scripting, do you think? There's one person at our company with privileges to call, but he's very difficult to raise...

SanfordWhiteman
Level 10 - Community Moderator

Hey Nancy,

Can you update the Correct answer to reflect the resolution we discussed offline? Now it looks like the "Correct" answer is that it doesn't work!

SanfordWhiteman
Level 10 - Community Moderator

You might as well email me so I can see what's up your setup. Would take anyone else a lot longer to get this.

SanfordWhiteman
Level 10 - Community Moderator

Please move the thread to Products and I'll pick up over there.

"Community" is for website feedback, not support -- and yes, this is confusing!

Casler_Nancy__N
Level 3

Thanks, I figured that out after I posted. I would appreciate your help!

Casler_Nancy__N
Level 3

Meaning, I figured out I posted in the wrong spot, not how to suppress default text