• Resolved mariosonzogni

    (@mariosonzogni)


    Good morning,
    My client would like to know if it is possible to arrange for a copy of the same email to be sent to the manager as a confirmation when the hotel manager resends an email to the client via the dedicated page.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author benitolopez

    (@benitolopez)

    Hi,

    You can use this filter: https://github.com/wp-hotelier/wp-hotelier/blob/main/includes/emails/class-htl-email.php#L268

    You need to pass the ID of the email. Each email has its own ID. The ID is defined here (this is for the confirmation email): https://github.com/wp-hotelier/wp-hotelier/blob/main/includes/emails/class-htl-email-guest-confirmed-reservation.php#L27

    For example:

    function hotelier_custom_email_recipient_guest_confirmed_reservation( $recipient ) {
    $recipient .= ',[email protected]';
    return $recipient;
    }
    add_filter( 'hotelier_email_recipient_guest_confirmed_reservation', 'hotelier_custom_email_recipient_guest_confirmed_reservation' );
    Thread Starter mariosonzogni

    (@mariosonzogni)

    Good morning, So once I have modified this code when I send the confirmation email to the customer (as in the photo) will it also arrive at the hotel?

    Plugin Author benitolopez

    (@benitolopez)

    Hello,

    My code was just a starting point and as I said, you need to use the correct email ID. My example is for the confirmation email.

    For the ‘Request received’ email you need to also add this line:

    add_filter( 'hotelier_email_recipient_guest_request_received', 'hotelier_custom_email_recipient_guest_confirmed_reservation' );

    For the ‘Cancelled reservation’ email you need to also add this line:

    add_filter( 'hotelier_email_recipient_guest_cancelled_reservation', 'hotelier_custom_email_recipient_guest_confirmed_reservation' );

    For the ‘Guest invoice’ email you need to also add this line:

    add_filter( 'hotelier_email_recipient_guest_invoice', 'hotelier_custom_email_recipient_guest_confirmed_reservation' );

    Thread Starter mariosonzogni

    (@mariosonzogni)

    I inserted this code inside the function but now no more emails are invited, not even those that arrive automatically. By deleting the code, the automatic emails started working normally again…but unfortunately the problem remains

    Plugin Author benitolopez

    (@benitolopez)

    I tried the code and it worked in my installation. So the issue is probably related to your email server now. Try to append only one email. And check your server mail logs and the spam folder. the code is correct so it should work.

    Thread Starter mariosonzogni

    (@mariosonzogni)

    Good morning, the email works, but there is a problem, that is, now the hotelier receives a double email. So I removed the hotelier’s email from the plugin (I mean from the graphical interface of hotellier, keeping it only in the code). Now only one email arrives to the hotelier, the email is wrong because some information is missing, such as the reservation number and other data.

    Plugin Author benitolopez

    (@benitolopez)

    Don’t remove the hotelier’s email from the plugin, that must be there as always.

    When the hotelier receives a double email? And what is the exact code you are using now?

    • This reply was modified 1 month, 1 week ago by benitolopez.
    Thread Starter mariosonzogni

    (@mariosonzogni)

    He gets a double email every time someone books. He would like to get it only as explained above (and in fact that works now). Currently my code is as follows

    function hotelier_custom_email_recipient_guest_confirmed_reservation( $recipient ) {
    $recipient .= ‘,[email protected],[email protected]’;
    return $recipient;
    }
    add_filter( ‘hotelier_email_recipient_guest_confirmed_reservation’, ‘hotelier_custom_email_recipient_guest_confirmed_reservation’ );

    add_filter( ‘hotelier_email_recipient_guest_request_received’, ‘hotelier_custom_email_recipient_guest_confirmed_reservation’ );

    add_filter( ‘hotelier_email_recipient_guest_cancelled_reservation’, ‘hotelier_custom_email_recipient_guest_confirmed_reservation’ );

    add_filter( ‘hotelier_email_recipient_guest_invoice’, ‘hotelier_custom_email_recipient_guest_confirmed_reservation’ );

    Plugin Author benitolopez

    (@benitolopez)

    Maybe try with something like this:

    function hotelier_custom_email_recipient_guest_confirmed_reservation( $recipient ) {
    if ( isset( $_POST[ 'action' ] ) && 'editpost' == $_POST[ 'action' ] ) {
    $recipient .= ',[email protected],[email protected]';
    }

    return $recipient;
    }
    Thread Starter mariosonzogni

    (@mariosonzogni)

    Good morning, thank you, my client says the problem seems solved

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.