0

I am trying to create a pardot form handler that will notify 1 of 3 different emails, dependent upon the choice the user makes on a specific form field.

I was directed to the Knowledge base article here: http://help.pardot.com/customer/portal/articles/2125987-using-form-field-based-completion-actions

and I tried to implement this code snippet (although it states this should be placed in the "Thank You" code for the pardot form, and I can't find that)

<script type="text/javascript">
var email = encodeURIComponent('%%email{js}%%')
switch('%%your_field_id{js}%%')
{
case 'VALUE_1': document.write('<iframe src="FORM_HANDLER_1_URL?email=' + email + '" height="1px" width="1px" />');
break;
case 'VALUE_2': document.write('<iframe src="FORM_HANDLER_2_URL?email=' + email + '" height="1px" width="1px" />');
break;
}
</script>

Here is roughly what I ended up with, and pasted under my form html:

<script type="text/javascript">
var email = encodeURIComponent('%%email{js}%%')
switch('%%Product{js}%%')
{
case 'Integrated Solutions': document.write('<iframe src="MYSECRETURL?email=' + [email protected] + ' &Product=%%Product%%&first-name=%%first-name%%&last-name=%%last-name%%&company=%%company%%" " height="1px" width="1px" />');
break;
case 'Internet of Things': document.write('<iframe src="MYSECRETURL?email=' + [email protected] + '&Product=%%Product%%&first-name=%%first-name%%&last-name=%%last-name%%&company=%%company%%" '" height="1px" width="1px" />');
break;
case 'Mobile POS Solutions': document.write('<iframe src="MYSECRETURL?email=' + [email protected] + '&Product=%%Product%%&first-name=%%first-name%%&last-name=%%last-name%%&company=%%company%%" '" height="1px" width="1px" />');
break;
}
</script>

Can anyone help me find out what I am doing wrong here? Where is this "Thank you" code?

2 Answers 2

1

The "Thank You" code is the second tab in the Pardot form setup wizard labeled "4. Completion Actions".

Here's a screen capture with the "Thank You Code" tab highlighted in yellow: enter image description here

0

The best solution is to use advanced dynamic content in your autoresponder email. So depending on what option is selected in the form, different content can presented.

If youre set on using the code above. Pardot is unable to send emails directly from calling a URL unless you're using the API. (If this is the case, I'd advise that you setup the authentication and email sending call server-side and use a post to evoke this from the code you've referenced above.)

Furthermore, the code referenced in the knowledge base article: <iframe src="FORM_HANDLER_1_URL?email=' + email + 'FORM_HANDLER_1_URL' should be replaced with the URL of a form handler URL which should be setup to include a completion action, sending autoresponder email. So when the form is completed, the code above runs, evoking the specific form handler for each each selection in the case, which then sends the specific email.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .