AutoResponder emails with conditional statments?

Hi,
A bit of a general question regarding AutoResponders

Is it possoible to set one up so that if Client Books an Appointment then wants to cancel it.
within 24 hours of the date mentioned in email compared with the current date/time message recived then email A is sent to them

If they send the same email after 24 hours then they recive email B ?

And can this potentially be linked to the APP + or other Wordpress plugins?

Thanks
Tom

  • Adam Czajczyk

    Hey Tom,

    I hope you're well today and thank you for your question!

    The first part should be fairly easy: using plugin such as our own "e-Newsletter" you could create this two e-mails. The hard part is to trigger message delivery upon set of pre-defined conditions hooked to Appointments+ or other plugins.

    As for our Appointments+ let me please ask our 2nd-line support guys if there's an easy way to do this. That being said, please keep an eye on this thread for further updates and information.

    As for other (especially 3rd-party) plugins, this may require some custom job for which you may want to ask at our "Jobs & Pros" job board here:

    https://premium.wpmudev.org/wordpress-development/

    Cheers,
    Adam

  • Hoang Ngo

    Hi @Tom,

    I hope you are well today.

    Just for clarification, if client want to cancel the booking within 24hours after the appointment created, we send them email A, if after, we send email B?

    If that, you can use this code. Please add this code to your theme functions.php or use mu-plugins

    add_filter( 'app-messages-cancellation-body', 'cancel_message_condition', 10, 3 );
    function cancel_message_condition( $body, $r, $app_id ) {
    	$date_created = strtotime( $r->created );
    	if ( strtotime( '+24 hour', $date_created ) > time() ) {
    		//still not over 24hours
    		$body = 'Your message for cancellation before 24hours';
    	} else {
    		//more than 24 hours
    		$body = 'Your message for cancellation after 24hours';
    	}
    
    	return $body;
    }

    For the integration Appointments + with 3rd plugin, can you please let me know more info?

    Best regards,
    Hoang

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.