Home / Admin / Donation Form Email Check
Duplicate Snippet

Embed Snippet on Your Site

Donation Form Email Check

If you need to do manual validation of an email when a donation is being submitted (only accepting emails from certain domains or manually blocking for spam reasons).

Code Preview
php
<?php
add_filter('charitable_validate_donation_form_submission_email_check', 'charitable_test_for_email', 10, 2 );
function charitable_test_for_email( $valid, $submitted ) {
	$email = $submitted->get_submitted_value( 'email' );
	// Add your logic here to see if the email is valid or not.
	// Return false if not valid, otherwise let the validation continue by passing back $valid.
	// if ( something ) {
	// return false;
	// }
	// 
	return $valid;
}

Comments

Add a Comment