Appointments+ Notification Address

Hi - can you please let me know how to change the "From" address for an Appointments+ notification email. It seems to be arbitrarily pulling in one of the site admins - none of which are addresses from the site domain, so we are seeing SPF failures.

Once of the other threads seemed to imply there was a "From" setting on Appointments->Settings->General, but I can't seem to find it.

  • Michelle Shull

    Hi there!

    Appointments should be using the default site email address here, wordpress@yoursite.com, to send confirmation emails. There is a plugin which will let you change that default address: https://wordpress.org/plugins/wp-change-default-email/, it's super lean so it won't be a burden on your resources at all.

    Also, make sure to update to the latest version, which was released just this week. There are a bunch of tweaks and fixes in there.

    Thanks!

  • Dave Steer

    Thank you for the response, but that doesn't solve my problem, because if I change the default address, then all notifications site-wide will go to that address. I just want appointment notifications to be sent from a specific address. (You need to think in an agency environment to get this - notifications need to come from, and reply to the client, but site-related WP communication needs to go to the agency).

    Is there any way of overriding this?

  • Jude

    Hi there @Dave Steer

    This is not possible out of the box for confirmation mails or reminders

    I just want appointment notifications to be sent from a specific address.

    You can use this code to change appointment notifications. Just copy this code into your functions.php file, in your child theme or a site specific plugin if you use one.

    add_filter('app_notification_email',  'custom_mail' );
    function custom_mail ($mail)
            {
                  return "appointments_admin@mysite.com" ;
            }

    Cheers
    Jude

  • Dave Steer

    Thank you Jude. This fix doesn't work though, since the filter you mentioned is designed to change the To: field (but see the note further down). The From field seems to be set in the function message_headers(), and there is another filter altering that, so the following needs to be modified in functions.php:

    add_filter('wp_mail_from', 'custom_mail' );

    Additionally, the "To:" field for new appointments is not actually filterable - this is defined on line 4417 of appointments.php and is hard-coded, so notification messages for new appointments are being sent to all administrators of the site. I think this is a bug - surely just the service provider should receive these notifications? Either way, can I ask that a filter is added to this line, or the functionality is corrected so that just the service provider is notified?

    //  Send a copy to admin and service provider
    				$to = array( $this->get_admin_email( ) );

    Thanks

    Dave

  • Jude

    Hi there @Dave Steer

    The From field seems to be set in the function message_headers(), and there is another filter altering that, so the following needs to be modified in functions.php

    I agree but filtering something there would alter from fields in messages both from clients and sites and would be somewhat counter productive for your use case.

    I think this is a bug - surely just the service provider should receive these notifications?

    I would say this is intended behaviour but could definitely be improved with a filter.

    Either way, can I ask that a filter is added to this line, or the functionality is corrected so that just the service provider is notified?

    I will mark this as a feature request, till it comes out you may need to go ahead and add it in the file yourself. Same for the dual from email filter you may need to add. I think both these features add valuable functionality with very little efforts/overhead.

    Thanks for bringing this up.

    Cheers
    Jude

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.