Skip to content

Instantly share code, notes, and snippets.

@mmlin
Created June 23, 2015 04:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmlin/15e4be136a1bff3e03dc to your computer and use it in GitHub Desktop.
Save mmlin/15e4be136a1bff3e03dc to your computer and use it in GitHub Desktop.
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