• Resolved WP-Henne

    (@wp-henne)


    Hello!

    Is there an action hook for switching the redirection on and off in the plugin? Background: I would like
    to control this function from a separate plugin.

    Thanks a lot!

Viewing 1 replies (of 1 total)
  • Hello @wp-henne

    we don’t have a hook within out plugin but you can use WordPress standard hooks. I use this snippet to redirect all email when I’m on a development site (domains ending with “.loc”):

    // redirect all e-mails to me
    if( strpos( $_SERVER['SERVER_NAME'], '.loc' ) ){
    	add_filter( 'wp_mail', function ( $args ) {
    		$args['to'] = '[email protected]';
    		$args['subject'] = '[' . $_SERVER['SERVER_NAME'] . '] ' . $args['subject'];
    		return $args;
    	}, 1000 );
    }

    a simplified version could be:

    add_filter( 'wp_mail', function ( $args ) {
    	$args['to'] = '[email protected]';
    	return $args;
    }, 1000 );

    best regards, Hannes

Viewing 1 replies (of 1 total)
  • The topic ‘action hook for enabling and disabling redirection’ is closed to new replies.