Use additional fields as extra recipients of emails

I have added two additional fields as email addresses.

It is vital that the appointment confirmations and reminders go to these people too.

Can you tell me which line of appointments.php I should change? I'm not a PHP programmer, but I am a developer and I am happy to make the change if I'm given a clue.

thanks

  • Jack Kitterhing
    • Code Norris

    Hi there @Stephen,

    Hope you're well today and thanks for your question! :slight_smile:

    Can you confirm the emails you want to go to these recipients? The client ones, such as your appointment has been confirmed with the reminder, or the service provider based ones?

    Please advise and I'd be happy to point you in the right direction. :slight_smile:

    Thank you!

    Kind Regards
    Jack.

  • Stephen
    • Flash Drive

    The client ones, the confirmation and the reminder

    I have two additional fields

    FIELD_PARTNEREMAIL
    FIELD_3RDPERSONEMAIL

    I need these emails to go the appointment booker and whatever is entered in these two fields as well.

    thanks

  • Jack Kitterhing
    • Code Norris

    Hi there @Stephen,

    Hope you're well today and thanks for the additional information.

    You'll want to take a look at the following files

    appointments/includes/addons/app-users-additional_fields.php

    appointments/appointments.php line 4324

    The additional fields file, will show how they are handled and saved in the database, then line 4324 of appointments.php is where the send confirmation email message is fired from. :slight_smile:

    Thanks!

    Kind Regards
    Jack.

  • Jack Kitterhing
    • Code Norris

    Hi there @Stephen,

    Hope you're well today! :slight_smile:

    In your sublime text editor, such for

    /*******************************
    * Methods for Confirmation
    ********************************
    
    	/**
    	 *	Send confirmation email
    	 *  @param app_id: ID of the app whose confirmation will be sent
    	 */
    	function send_confirmation( $app_id ) {
    		if ( !isset( $this->options["send_confirmation"] ) || 'yes' != $this->options["send_confirmation"] )
    			return;
    		global $wpdb;
    		$r = $wpdb->get_row( $wpdb->prepare("SELECT * FROM {$this->app_table} WHERE ID=%d", $app_id) );
    		if ( $r != null ) {
    
    			$_REQUEST["app_location_id"] = 0;
    			$_REQUEST["app_service_id"] = $r->service;
    			$_REQUEST["app_provider_id"] = $r->worker;

    That will get you onto the piece of code you need, (Screenshot attached).

    Thanks!

    Kind Regards
    Jack.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.