Hi,
I have multiple motorcycle listings on my website, and for all of them I link to one contact form (using easy contact right now, which I have modified.) In any case, I would like to display the title of the Page when they land on the contact form (i.e. "Regarding: 2008 Specific Motorcycle") and I was doing that in the past by using WordPress queryvars. I'm trying to go from 3 form plugins down to one: I've already removed one, and Easy Contact is the other one.
So, what is the best way to do what I need here: I would like the Gravity contact form, when they land on it, to know what Page the click came from, and then also send the URL of that page in the email notification.
If none of that makes sense, see these pages for the way it works now:
[linkrot]
The "Request more information" link is a link to the contact form, and it looks like this:
[linkrot]
3676 is the ID of that Page. When that ID goes to the contact form, I can use queryvars and determine the URL (permalink) and the Title of the page (which is displayed above the form. Here's the code I use in functions.php:
// add a query var for the postid to send to the contact form
add_filter('query_vars', 'parameter_queryvars' );
function parameter_queryvars( $qvars ) {
$qvars[] = 'postid';
return $qvars;
}
and the modification to the Easy Contact plugin:
// grab the postid if it was sent as a query var
global $wp_query;
if (isset($wp_query->query_vars['postid'])) {
$postID = $wp_query->query_vars['postid'];
$form .= "\n\t<p><strong>Regarding</strong>: " . get_the_title($postID) . "</p>";
}
I'm sure I made this sound more complicated than it really is, and there's probably a really easy way to do this with GF that I have overlooked.
I was using Joost's referrer plugin for GF, but that appended ALL the site visit history as referrers to the email notifications, and when employees respond to the contact, they don't always think to remove all that data, so the response to the customer has 20 or 50 or 300 URLs that they visited. Not cool. So, I stopped using that. If I can recreate what I have with Easy Contact now, using GF, I will dump yet another form plugin.
If you want to test the Easy Contact form for some reason, please feel free to do so, just put TEST somewhere in the name fields.
Hope that makes sense. Thank you.