Created
June 23, 2015 04:34
-
-
Save mmlin/15e4be136a1bff3e03dc to your computer and use it in GitHub Desktop.
Pardot Hack: Don't link prospects from forwarded emails!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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