Appointments+ how to send email to multiple

How can I send a copy of emails to sevral different email adresses – e.g. the confirmation email?

  • Nastia
    • Support Rock Star

    Hello @lars_horl, I hope you are well today!

    Thank you for your question!

    By default in Appointment+ settings, notifications are sent to Service Provider, to admin and to a client.

    If I understand you correctly, you wish to send a confirmation email to each client for one appointment?

    You can have multiple users in a schedule, i.e, if you have a service with a capacity to 20 appointments.

    But you need to schedule the appointment for one user at a time.

    Each user will have an email associated, and every email will be sent individually.

    I hope this helps!

    Cheers,

    Nastia

  • Nastia
    • Support Rock Star

    Hello @lars_horl, I hope you are doing well today!

    Searching through the forum, I have found a code written by @ash in this ticket.

    With this code the WordPress will send the confirmation notification to selected email. Please put it on the functions.php file of your theme.

    add_action( 'app_confirmation_sent', 'app_confirmation_sent_cb', 99, 3 );
    function app_confirmation_sent_cb( $body, $r, $app_id ){
    global $appointments;
    $to = 'email@gmail.com';

    $provider_add_text = sprintf( __('A new appointment has been made on %s. Below please find a copy of what has been sent to your client:', 'appointments'), get_option( 'blogname' ) );
    $provider_add_text .= "nnn";

    wp_mail(
    $to,
    $appointments->_replace( __('New Appointment','appointments'), $r->name, $appointments->get_service_name( $r->service), $appointments->get_worker_name( $r->worker), $r->start, $r->price, $appointments->get_deposit($r->price), $r->phone, $r->note, $r->address, $r->email, $r->city ),
    $provider_add_text . $body,
    $appointments->message_headers( )
    );
    }

    Please change email@gmail.com with the email you wish to send the notification. You may copy paste this code in the functions.php file multiply times.

    I have tested and it’s working on my installation.

    @vamsi Pulavarthi, I hope this code is what you are looking for :slight_smile:

    If we can be of any further assistance, please, let us know!

    Cheers,

    Nastia

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.