The wsf_action_email_template filter allows you to modify the email template that is parsed prior to the email being sent out. This will contains the standard WS Form email wrapper if the Wrap Message in Header and Footer setting is enabled, or just #email_message if it is disabled.


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


  1. $email_template String
    The HTML email template used by WS Form to render the email.
  2. $form Form Object
    The form object.
  3. $submit Submit Object
    The submit object.
  4. $action Array
    The action configuration.


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

	// Return value
	return $email_template;

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

Source File

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