I noticed some of the plugin emails like subscribe by email and other send out email but have no-re

Hey,

I noticed some of the plugin emails like subscribe by email and others send out email but have no-reply@subdomain.mysite.com in the email. How can all references to the subdomain be removed for both internal and customer facing emails they receive from the site for all plugins. This also results in more messages from the site likely going to spam folders I believe.

It really should always have the email address of the site (i.e. the mapped domain name).

Don't want to be exposing the subdomain.mysite.com too much to confuse people...

:slight_smile:

Greg

  • Ignacio

    Hi @Greg

    In case you are using our Domain Mapping Pluing, this could work on your site:

    <?php
    add_filter( 'incsub_sbe_from_email', 'greg_set_sbe_from_email' );
    function greg_set_sbe_from_email( $email ) {
    	global $wpdb;
    
    	if ( defined( 'DOMAINMAP_TABLE_MAP' ) ) {
    		$domain = $wpdb->get_var( $wpdb->prepare( "SELECT domain FROM " . DOMAINMAP_TABLE_MAP . " WHERE blog_id = %d LIMIT 1", get_current_blog_id() ) );
    		if ( ! empty( $domain ) )
    			return 'no-reply@' . $domain;
    	}
    
    	return $email;
    }

    For better results, create a new file in your wp-content/mu-plugins folder. Call it sbe-hooks.php for example. If the folder does not exist, create it. MU Plugins are always activated.

    The code just checks if the site has a mapped domain, if it has it changes the From Email for no-reply@domain.com, otherwise, the email will be the one that you put on wp-admin/network/settings.php?page=sbe-network-settings.

    You need to activate the plugin in your main site if you want to see those Network settings but there's a workaround for that, just activate it in your main site, change the settings and deactivate it again. The settings will still be there but you won't have the plugin active in your main site. However, the plugin should work in every subsite that is active.

    Let me know if that works for your.

    Regards.
    Ignacio.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.