Supporter - Premium Support - noreply@

Perhaps I'm missing something here, I'm not sure but from what I can tell from of your documentation, the premium support area when filled in and submitted by a user will use their websites e-mail address (The one located under Settings --> General Settings) however when I receive these e-mails the reply address I'm seeing is a noreply@sub.domain.net

I scouted the database but couldn't find anything there and I checked the users profile e-mail and Settings --> General Settings.

Am I missing something, somewhere?

WP 3.1
Latest Supporter version as of posting this.

  • Philip John
    • DEV MAN’s Apprentice

    Hi Tim!

    When a user sends you a support request through the Premium support section it is sent from the address attached to their user account.

    This is so that any replies you send go to the person who requested support in the first place.

    I hope that clears things up for you.

    Phil

  • Timothy
    • Chief Pigeon

    Well thats how I thought it worked, but I must have something interfering with with the address.

    Without revealing e-mail addresses publicly I've attached 3 screen shot. 1 is of the blog e-mail (member site), 1 is of the users e-mail (profile) and the third is of the actual e-mail received.

    Don't suppose you know where it might be getting a noreply@ e-mail from as the reply to address for a supporter user?

  • Philip John
    • DEV MAN’s Apprentice

    Hi Tim,

    I suspect this may be a PHP setting... my guess is that PHP is forcing all e-mails sent to use that noreply@ address rather than the e-mail address that Support is passing through the WP mail facility.

    You might want to check your PHP config files for that e-mail address, or even Apache config files.

    If it pops up anywhere you should be on your way to finding out how to stop it over-riding WP.

    Phil

  • Timothy
    • Chief Pigeon

    They were sure it wasn't a setting on the server and whilst they were looking into it I thought I would look at the code of my whole install.

    I notice in buddypress there is a filter added:

    buddypress/bp-core/bp-core-filters.php

    /**
     * bp_core_email_from_name_filter()
     *
     * Sets the "From" address in emails sent
     *
     * @package BuddyPress Core
     * @global $current_site Object containing current site metadata
     * @return noreply@sitedomain email address
     */
    function bp_core_email_from_address_filter() {
    	$domain = (array) explode( '/', site_url() );
    
    	return apply_filters( 'bp_core_email_from_address_filter', __( 'noreply', 'buddypress' ) . '@' . $domain[2] );
    }
    add_filter( 'wp_mail_from', 'bp_core_email_from_address_filter' );

    Because your plugins are compatible with Buddypress, can you not add a filter to counter what Buddpreypress is doing, so that the desired and expected results actually happen? Please :slight_smile:

  • Rich
    • Design Lord, Child of Thor

    I agree.

    I, also, have the issue with users premium support emails having the "noreply@" return address and it's a huge hassle to go into the backend and find the possible sender of the email by finding who is the admin of the blog that it was sent from.

    And then every subsequent email from them (if sent through premium support) has to go through this route as well. It's especially aggravating if the response needed is just a simple "Yes" or "No".

  • Timothy
    • Chief Pigeon

    Hi Rich.

    To confirm, this is how to change the plugin to prevent Buddypress adding its filter:

    (Their filter it removes the wordpress@ address as well, so its not all that bad! :slight_smile:

    Locate the file:

    /wp-content/mu-plugins/supporter-premium-support.php

    Around line 94 you will find the "supporter_support_page()" function, within this function add the two lines:

    remove_filter('wp_mail_from', 'bp_core_email_from_address_filter' );
    remove_filter('wp_mail_from_name', 'bp_core_email_from_name_filter');

    This removes the Buddypress filter for the e-mail headers affecting name and from address.

    Here is how the code looks to me after the change:

    //------------------------------------------------------------------------//
    //---Page Output Functions------------------------------------------------//
    //------------------------------------------------------------------------//
    
    function supporter_support_page() {
      global $current_user;
      remove_filter('wp_mail_from', 'bp_core_email_from_address_filter' );
      remove_filter('wp_mail_from_name', 'bp_core_email_from_name_filter');
      ?>
    	<div class="wrap">
    	<h2><?php _e('Premium Support', 'supporter') ?></h2>

    Hope this helps you deal with the annoyance mate! :wink:

  • Philip John
    • DEV MAN’s Apprentice

    Hi guys,

    Nice work on finding that filter!

    I'll pass this onto the developer for consideration. I have a feeling this may cause knock on effects elsewhere, not just with Supporter so I'd be aware of that.

    Also, you might be better off adding those two lines to your own plugin rather than modifying Supporter.

    That way, you won't lose it when Supporter updates!

    Phil

  • Timothy
    • Chief Pigeon

    Could you perhaps elaborate how it might cause such negative effects, from what I see the supporter_support_page() function only seems to be pulled on that one page. I tested Contact 7 (which I found out had the same issue) and the e-mail issue continued in that plugin until I included the remove_filter. So it seemed that it had no affect there....

    I didn't see the file included elsewhere either although admittedly I never took an extensive amount of time to check.

    Including it in that function seemed logical as that was making the user data global?

    Adding another plugin simply adds another included file and if you keep including extra ones here and there the madness would never end. I'd personally rather keep to fewer plugins to avoid bloating and I'm finding I'm close to bloat now (So many cool plugins here!!). lol

    If it was coded as a separate plugin and activated network wide, it would still be called on that page anyway, so I'm not sure what negative affects it would avoid with separate plugin a part form a few moments of inconvenience in adding the code next time I update again.. I document my changes so that when it comes to upgrades I can consider my past code changes. :slight_smile:

    I would appreciate feed back form the developer to ensure this doesn't cause an issue. :slight_smile:

    Thanks for getting back to me!

  • Philip John
    • DEV MAN’s Apprentice

    Tim,

    Could you perhaps elaborate how it might cause such negative effects

    As it's messing with BuddyPress functionality it could affect other e-mails BP sends out. For instance, it *might* inadvertently send your user's e-mail address to each other where they previously thought they would remain private.

    I can't be sure on that because I'm not entirely certain how BP works but it's something that sprang to mind based on how it seems to filter all e-mails.

    If you're documenting your changes and comfortable with being able to re-apply them after an upgrade then sure, go for it - I was thinking of future-proofing but you're obviously doing that in your own way so that's cool.

    Phil

  • Timothy
    • Chief Pigeon

    Thanks Phil, I appreciate your feedback on this. I think the filter simply only alters the wp_mail() function regarding name and address which extends the usw php mails function . I'm going to have a look into it though as it is something to consider.

    If one of your Devs has any knowledge or experience of potential issues on this then I would appreciate their advice as well.

    Thanks again Phil for taking the time to reply! :slight_smile:

  • Timothy
    • Chief Pigeon

    That is excellent news Aaron!

    When you say "properly", did I miss something or do something wrong? Would be good to know so I can adjust it for my install. Do you mean with checks to see if Buddypress is installed with conditional statements?

    Thanks for getting back to me as well! :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.