Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pardot Hack: Don't link prospects from forwarded emails!
// Forgets the current user (similar to clearing cookies)
// if he changes the email address.
//
// Requires jQuery and the "Not You" setting on the Pardot form.
//
$(function() {
var $email, $notYou, href;
// Get the email section from the Pardot form.
$email = $('#pardot-form p.email');
// Hide the "Not You" option.
$notYou = $email.find('span.description').hide();
$notYou.prev('br').hide();
// Get the "Not You" URL and ping it to forget the current user,
// but only if the email is being changed.
href = $notYou.find('a[href^="/form/incorrectProspect/"]').attr('href');
$email.find('input').change(function() {
href && $.get(href);
// This only needs to be run once, not every time email changes.
href = null;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment