Mails sent from the subsite, not from the mapped domain

Hi,

I've got a problem when using Subscribe by Email on a mapped domain.

Mails are sent from the subsite inside my network installation, and not from the mapped domain.
Something like:
no-reply@subsite.creersonsite.net
Instead of:
no-reply@mappeddomain.com

Any idea?
Best Regards

  • aristath

    Hello again @Arom77,

    I just logged-in on your site and managed to see what the issue is.

    The plugin checks if it's installed on a multisite or not.
    If it's not installed on a multisite then it adds some settings on the single site's admin.
    When it's installed on a multisite, it does not check if it's network-activated or not, and assumes that it will be network-activated instead, adding a global settings page on the network admin (which can't be added if the plugin is not network-activated).
    Instead it should check that it's on a multisite AND it's network-activated.

    That's why you can't see the option to change the "from" address... the plugin is not network-activated.

    I have marked this as a confirmed bug and notified the plugin developer about it. We should have an update for you soon enough to fix this. :slight_smile:

    Cheers,
    Ari.

  • Ignacio

    Hi @Arom77

    I'm currently working on some fixes for SBE. @aristath had a good point, there's a little bug when activating in a single site. It gets the current site domain when is activated in a single site (and it doesn't even get the mapped one). But the plugin shouldn't get the mapped one or the site domain where you activated the plugin. It should get the network domain (that's usually your main site domain). Every email is sent based on the main site domain and not subdomains. You can hack this though using some code (let me know if you need it and I'll supply something for you).

    Now, in your case, there's a little solution for this:

    - Activate the plugin in your main site.
    - Go to Network>Settings>Subscribe by Email
    - Change the from email field for the one you'd like. Remember to be coherent with your server settings. Do not use a domain that is not from your server or you'll probably have problems with spam filters.
    - Deactivate the plugin in your main site.

    Now every mail sent from every subsite should be the one that you set in the options.

    Anyway, there will be a little fix for that in the next version.

    Regards.
    Ignacio.

  • Arom77

    Hi @Ignacio

    the plugin shouldn't get the mapped one or the site domain where you activated the plugin. It should get the network domain (that's usually your main site domain). Every email is sent based on the main site domain and not subdomains.

    So if I understand correctly, I'll get something like xxxxxx@creersonsite.net (creersonsite.net is my network domaine) and I can't get xxxxxx@mappeddomain.com, right?
    That could be a problem for some customers (because people who read their site don't have to know about creersonsite.net, that makes sense).

    You can hack this though using some code (let me know if you need it and I'll supply something for you).

    I need it :wink: thanks!

    Cheers

  • Tyler Postle

    Hey Arom,

    Hope you're doing well today!

    So if I understand correctly, I'll get something like xxxxxx@creersonsite.net (creersonsite.net is my network domaine) and I can't get xxxxxx@mappeddomain.com, right?
    That could be a problem for some customers (because people who read their site don't have to know about creersonsite.net, that makes sense).

    Yes, you're understanding that correctly :slight_smile:

    I need it :wink: thanks!

    No problem Arom, I have left a note for Ignacio so he's aware :slight_smile:

    Let us know if you have any other questions in the meantime!

    All the best,
    Tyler

  • Ignacio

    Hi @Arom77.

    Here's the code that you can use to override the from email:

    function sbe_hooks_set_from_email( $from_email ) {
    		$home_url = home_url();
    		$home_url = preg_replace( '/^http:\/\//i', '', $home_url );
    		return 'no-reply@' . $home_url;
    }
    add_filter( 'incsub_sbe_from_email', 'sbe_hooks_set_from_email' );

    You can add this code to a separate MU Plugin or a plugin and activate it.

    Let me know if it works for you.

    Regards.
    Ignacio.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.