Quantcast
Channel: WordPress.org Forums » [Contact Form 7] Support
Viewing all articles
Browse latest Browse all 49500

klode on "[Plugin: Contact Form 7] Add solution for 3rd party integration and managing errors"

$
0
0

I have reverse engineered a piece of your plugin.

In the file includes/classes.php, in the row 480, where there's a control in skip_mail parameter, I have added this code:

global $wpcf7;
if ( $this->skip_mail )
{
	if(isset($wpcf7->result["valid"]))
		if($wpcf7->result["valid"] == 1) return true;
		else return false;
	else
		return true;
}

In this mode, when there is a control with 3rd party integration, it's possible to set:

global $wpcf7;
$wpcf7->result["valid"] = 0; //in case of error
$cf7->skip_mail = true;

in order to declare the variable "mail_sent" on ajax response to false. Again, with this code:

$cf7->messages["mail_sent_ng"] = "Some error occured!";

it's possible to customize the message on return from Server.

That's it!

I hope this my little editing can help someone!!!

http://wordpress.org/extend/plugins/contact-form-7/


Viewing all articles
Browse latest Browse all 49500

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>