Debugging Contact Form 7

I’ve recently tried to install the plug-in Contact Form 7 on a the GrungeMag theme from Elegant Themes and here’s the contact form page – but I can’t seem to send email via the form! Any ideas from anyone out there how to repair this? I’ve found one helpful page yet I haven’t really stepped through it and see what I could do. Here are some interesting thoughts from the comments:

“You can use javascript to fire the tracking code to create a virtual page view in analytics, but you cannot properly implement the conversion tracking from Adwords without loading a separate page.    As you can imagine, I was slightly frustrated until I discovered a very quick and simple solution.

Important.. This solution only works if you have/want a designated landing page for all forms you are using with Contact Form 7.

Step 1: Browse to wp-content/plugins/contact-form-7

Step 2: Open the contact-form-7.js file in your favorite text editor.

Step 3: Look for the function:  wpcf7ProcessJson (line 63)

Step 4: Look for the if statement: if (1 == data.mailSent)  (line 90)

Step 5: Insert this line after the jquery (line 92) – location.href=”http://www.yourdomain.com/yourthankyoupage”;

Step 6: Save the file to your server, and test out the form.
Ideally, the author of this plugin will make a change in the next release that allows a custom variable (url) to be stored for each contact form.  But until then.. here’s your fix !!!”

My problem might be related to the solution above but I think Imight have t manipulate one of the files that Contact Form 7 as one comments suggest:

“here it is in non script format

Within the landing page you are directing to, add the below into the header..

openphp $formorigin = $_SERVER['HTTP_REFERER']; closephp

Then, on your landing page use the below code to display different messages depending on which page they came from.

openphp if($formorigin ==”http://domain.com/form1/”)
{ closephp
html p thankyou message for form 1 html close-p
openphp }
elseif($formorigin ==”http://domain.com/form2/”)
{ closephp
html p thankyou message for form 2 html close-p
openphp }
else
{ closephp
html p Content to display if visiting the page from anywhere other than your form page
openphp } closephp
"

Basically replace the openphp, closephp, html p and html close-p with the relevant markup”

So there. I’ll look in to this in more detail later.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s