Email Confirmation - using name instead of ID for CLIENT tag

When sending out emails for confirmation, can you tell me how the email can be made to include the First and Last name instead of the User Name [John Doe instead of userxyz, where userxyz being the login name the client chose]


  • Vinod Dalvi

    Hi Vandana,

    I hope you are well today and thank you for your question.

    To cahcieve this try adding the placeholders FIRST_NAME and LAST_NAME in the Confirmation email Message and add the following code in the functions.php file of your child theme.

    function my_app_expand_first_name ($msg, $app) {
    	if (empty($app->user))
    		return $msg;
    	$first_name = get_user_meta($app->user, 'first_name', true);
    	$msg = preg_replace('/FIRST_NAME/', $first_name, $msg);
    	$last_name = get_user_meta($app->user, 'last_name', true);
    	$msg = preg_replace('/LAST_NAME/', $first_name, $msg);
    	return $msg;
    add_filter('app_confirmation_message', 'my_app_expand_first_name', 10, 2);
    // add_filter('app_notification_message', 'my_app_expand_first_name', 10, 2);
    // add_filter('app_reminder_message', 'my_app_expand_first_name', 10, 2);

    Best Regards,
    Vinod Dalvi

  • Predrag Dubajic

    Hi @vandana,

    My apologies for the long overdue on this thread.

    By default a admin doesn't receive notification of a cancelled appointment, but you should be able to enable it by adding this code snippet in functions.php file of your theme:

    function my_app_email_on_appointment_cancelled ($app_id) {
    	global $appointments;
    	$to = $appointments->get_admin_email();
    	wp_mail($to, 'An appointment has been cancelled', "An appointment with ID {$app_id} has just been cancelled.");
    add_action('app-appointments-appointment_cancelled', 'my_app_email_on_appointment_cancelled');

    Let us know if this worked for you.

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.