In my confirmation emails it sounds too formal to use the clients full name. Is there an email placeholder which will return the clients first name only? If not can you suggest a better solution than my current one described below?
Right now I have an mu-plugin with the following code. It sets the first word the client has entered in the name field as the database entry for name and it takes any words they enter after and adds them to the beginning of the note field.
$myrows = $wpdb->get_row( "SELECT name, note FROM wp_app_appointments WHERE ID = '$insert_id'" ); $myrowsname = ucwords(strtolower($myrows->name)); $myrowsname = preg_split('/ /', $myrowsname, 2); $myrowsnote = "$myrowsname $myrows->note"; $wpdb->query($wpdb->prepare("UPDATE wp_app_appointments SET name='$myrowsname', note='$myrowsnote' WHERE ID = '$insert_id'"));
It works but it's not ideal as its hard to find customers on my admin pages because I only have first names in the name field. I want the name field to contain the clients full entry, but only include their first name in my email.