The wsf_action_email_headers filter allows you to modify the array of SMTP Headers when sending emails using the Send Email action. WS Form automatically sets header such as the content type, from and CC.


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


  1. $headers Array
    An array of strings, each containing an SMTP header.
  2. $form Form Object
    The form object.
  3. $submit Submit Object
    The submit object.
  4. $action Array
    The action configuration.


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

// Callback function for the wsf_action_email_headers filter hook
function my_hook_function( $headers, $form, $submit, $action ) {
	// Your code here ...

	// Return value
	return $headers;

Source File

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