Replies to confirmation emails go to wrong address

WordPress Event Management, Calendars & Registration Forums General Question Replies to confirmation emails go to wrong address

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 10 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12004

    Hi Stephen,

    I’ve been using your notification snippet (I swapped to the plugin version today though) with a client’s site which also uses another fairly common snippet in functions.php to send all site notifications from the client’s email address rather than the site admin email address.

    I’m seeing a strange situation where the event confirmation messages are being sent with the correct event organiser’s email address, but sometimes if people reply to that confirmation email their message gets send to the site admin. For example, the customer realises upon seeing the confirmation email that they’ve booked the wrong date so they reply with a request to change it.

    It’s like the confirmation messages contain a ‘reply to’ address instead of defaulting to the sending address. Are you able to shed any light on why this might be happening?

    Thanks so much.

    FYI, here is the snippet I used to change the site-wide sending email from wordpress@sitename.com: http://www.wprecipes.com/change-wordpress-from-email-header

    TS
    #12014

    Hi TS,

    “From” and “Reply-to” are different things so that above snippet on wprecipe will change the “from” but not reply to.

    E-mails are sent, by default, with the “from” and “reply-to” from the site admin email address (the e-mail address Event Organiser uses can be changed as per the eventorganiser_admin_email hook in the documentation linked to, but is site-wide ).

    As an aside, the email notification filter eventorganiser_booking_notification_email, changes which addresses the notification e-mail should be sent to (typically admin and/or event organiser – there’s a different, user-set, e-mail sent to the bookee).

    So to change the from/reply-to e-email you can use eventorganiser_admin_email. Or if you want to change it on a booking/event basis you can use the eventorganiser_booking_confirmed_email_headers to change the email headers directly.

    These are the default headers:

    // $from_email is, by default, the admin e-mail address.
    $headers = array(
        'from:' . stripslashes_deep( html_entity_decode( $from_name, ENT_COMPAT, 'UTF-8' ) ) . " <$from_email>",
        'reply-to:' . $from_email
    );

    To change the headers for booking confirmation e-mails

     add_filter('eventorganiser_booking_confirmed_email_headers', 'my_booking_confirmed_email_headers', 10, 2 );
     function my_booking_confirmed_email_headers( $headers, $booking_id ){
    
           //Change $headers as desired
           return $headers;
     }
    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.