• Resolved Sky007000

    (@sky007000)


    In the notification settings, I have set both the reply-to and admin email addresses to the same email, but the reply address that shows up in the emails sent is the website admin email. I don’t remember this happening when I was testing before.

    Example:
    Both notification settings above are set to ‘[email protected]’.

    When a reservation is made, the email that sent the notification (or shows up in the “FROM” of the email) is ‘[email protected]
    //end example

    Is there a way to have the “FROM” address the same as the address set in the notification settings? Or is this something that happened in an update?

    Thanks very much!

    https://www.ads-software.com/plugins/restaurant-reservations/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Sky007000

    (@sky007000)

    Ha ha! I found your solution already here:
    https://gist.github.com/NateWr/fbbe6f0eafa7359de161

    Thanks again, Nate!

    Hi Sky007000,

    Glad you were able to find the gist.

    The reason I use the overall admin email in the FROM address is because many shared web hosts set restrictions on sending emails. I’ve found the overall admin email is more reliable across the wide variety of hosts.

    But some people do still need to use that gist. I’m hoping to find a better way in the future to surface some of those solutions in the gist for others to use.

    Hi NateWr & Sky007000 – I need the same solution and can see the code but am unsure where/how to use it…

    Can you give me any advice here please? Thank you.

    Hi CyberMama,

    To use the gist linked above, you’ll need a raw text editor and the ability to upload a file to your website.

    Go to the gist link and click on the Download Zip button at the top right. Unpack the .zip file and it should provide a .php file. Open the .php file and change the email address in the following line to whatever you’d like:

    return ‘[email protected]’;

    Save the file and then upload it to your /wp-content/plugins/ directory. You can then activate the plugin from your WordPress admin area.

    If editing the code in a PHP file sounds too daunting for you, send me a message from the contact form on my site. Include the email address you want to be used in the FROM header and I can provide you with something a bit easier to use.

    Hi Nate,
    Thanks for that – did all the above – seemed straightforward enough, but got a ‘fatal error’ notice on uploading. I just uploaded the php file to the directory – should I zip it…?

    Tried uploading folder with pho file in as well – also fatal error…

    Message:

    Parse error: syntax error, unexpected ‘@’ in /home/mysite/public_html/wp-content/plugins/fbbe6f0eafa7359de161-cbfae2087e29f3b736c94520717125a19feaf8d3/rtb-override-notification-from-email.php on line 32

    My guess is that you’ve missed out on the single quote marks here:

    https://gist.github.com/NateWr/fbbe6f0eafa7359de161

    Can you post the code in your file?

    I think they’re there…

    I edited the php file in text editor so it reads:

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    <?php
    /**
     * Plugin Name: Notification Email Override for Restaurant Reservations
     * Plugin URI: https://themeofthecrop.com
     * Description: Override the From email address used in booking notification emails
     * Version: 1.0
     * Author: Theme of the Crop
     * Author URI: https://themeofthecrop.com
     * License:     GNU General Public License v2.0 or later
     * License URI: https://www.gnu.org/licenses/gpl-2.0.html
     *
     * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
     * General Public License as published by the Free Software Foundation; either version 2 of the License,
     * or (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
     * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     *
     * You should have received a copy of the GNU General Public License along with this program; if not, write
     * to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
     */
    if ( ! defined( 'ABSPATH' ) )
    	exit;
    
    /**
     * Set the email address used in the From headers
     */
    if ( !function_exists( 'rtbonfe_set_from_email' ) ) {
    add_filter( 'rtb_notification_email_header_from_email', 'rtbonfe_set_from_email' );
    function rtbonfe_set_from_email( $email ) {
    
    	return ‘[email protected]’;
    }
    } // endif;

    But once I have the edited php file, how do I upload? Do I zip it again or upload straight to the plugins folder?? I’ll send you the email I need to use via the contact form on your site like you suggested previously if that’s ok?

    Hi CyberMama,

    The quotes you’ve used are invalid for PHP code. You need to use the straight single quotes (‘) instead of the angled quotes (‘).

    I’ve responded to your email request and attached a copy of the .php file that should work for you.

    For anyone else reading this, the following line:

    return ‘[email protected]’;

    Should be:

    return '[email protected]';

    Thanks Nate – you’re a star.

    And your themes look very cool ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Admin email in settings is not the reply-to address being used’ is closed to new replies.