Celebrate WordCamp Asia! - 30% OFF with coupon WC30 at checkout - Terms

wsf_action_email_email_validate

Description

The wsf_action_email_email_validate filter allows you to validate email addresses prior to sending emails using the Send Email action.

A detailed tutorial about using this filter can be found here:

Usage

add_filter( 'wsf_action_email_email_validate', 'my_hook_function', 10, 4 );

Parameters

  1. $valid Boolean
    Whether the email address is valid or not. Set to false to invalidate the email address.
  2. $email String
    The email address.
  3. $form_id Integer
    The form ID.
  4. $field_id Integer
    The field ID. Will be set to false when emails are checked at Send Email action level.

Example

// Callback function for the wsf_action_email_email_validate filter hook
function my_hook_function( $valid, $email, $form_id, $field_id ) {
	
	// Your code here ...

	// Return value
	return $valid;
}

// Add a callback function for the wsf_action_email_email_validate filter hook
add_filter( 'wsf_action_email_email_validate', 'my_hook_function', 10, 4 );

Source File

This hook can be found in: <plugin root>/includes/actions/class-ws-form-action-email.php