Auto signup, Bio in Confirmation mail, calendar style

Hello there !

After hesitating a lot, I finally use Appointments + for the website I'm creating.

It's much more powerful that any other plugin, as soon as you can customize it the way you want :slight_smile:

On that journey, I'm stuck with three questions :

1/ Is it possible to use the Booking calendar as a Signup form too.
For example, a visitor comes on the A+ page with the monthly schedule, selects a day, then an available slot, and then the Confirmation form appears.
In the Confirmation form, I'll have several fields (the classic one and some I'll add), and what I would love is that when the visitor Confirms it's appointment, it creates him automatically an account on the website with his Name, Mail, Phone, and Password (if possible also his Birthday).

If it's possible it could save my process !

2/ I did not set up Bio page for my providers yet.
What I want to know, is if there is a way to send in the Appointment Confirmation mail the Bio of the Service Provider ? That would be great too, and will help me to be closer to my customers.

3/ I feel really bad when I see the calendar's style.
Do you know if there is anywhere or if you have pre-made calendar styles somewhere, even some specific CSS ?
If you don't I'll create my own and be pleased to share it, but the default calendar style can't work for a chic website :slight_smile:

Thanks a lot for your answers !!

Regards,
Guillaume

  • Jude

    Hi there @Guigro

    Thanks for your kind words, Glad you liked the plugin.

    1/ Is it possible to use the Booking calendar as a Signup form too.

    Yes its possible to do this, you need to specify that membership is required as part of the signup process and include a login form shortcode in the appointments page. See screenshot.

    2) What I want to know, is if there is a way to send in the Appointment Confirmation mail the Bio of the Service Provider ?

    This is not possible out of the box. You'll be able to do this with some custom code.

    3/ I feel really bad when I see the calendar's style.
    Do you know if there is anywhere or if you have pre-made calendar styles somewhere, even some specific CSS ?

    This is not possible. You will need to use only CSS to get this done. Using another calendar will not work with the plugin.

    You can style the calendar really chic using just CSS.

    Cheers
    Jude

  • Guigro

    Hello Jude, thanks a lot for your answer !

    1/ I already tried it that way, what I meant is that my clients go on the appointment page with the calendar, select a slot, then the Confirmation Form will Confirm the Appointment + create them an account based on their Name, Mail, Phone (and if possible some more fields).

    Is that possible ?

    2/ Ok I'll do it my own, if you have any tips to start digging it will be great :slight_smile:

    3/ I meant only CSS pre-made styles (like a CSS file I could add to my custom styles to have a better render, instead of doing it from scratch).

    Thanks again for your answer !!!
    Regards,
    Guillaume

  • Tyler Postle

    Hey Guillaume,

    Hope you're having a great weekend!

    1/ I already tried it that way, what I meant is that my clients go on the appointment page with the calendar, select a slot, then the Confirmation Form will Confirm the Appointment + create them an account based on their Name, Mail, Phone (and if possible some more fields).

    Is that possible ?

    This form doesn't hook into the registration at all, I do like that idea though, I'm going to mark it as a feature request for the plugin :slight_smile: hopefully we can add it in the future. In the meantime, it would need to be custom developed - sounds like you may be able to do that yourself, or we do have a jobs board you could check out too: https://premium.wpmudev.org/wordpress-development/

    3/ I meant only CSS pre-made styles (like a CSS file I could add to my custom styles to have a better render, instead of doing it from scratch).

    We don't have any pre-made styles, but we would be happy to help with styling, if you get stuck at any parts just let us know and we'll see what we could do.

    Would love to see the styling when you're done too :slight_smile:

    If you have further questions on this just let us know.

    All the best,
    Tyler

  • Guigro

    2) What I want to know, is if there is a way to send in the Appointment Confirmation mail the Bio of the Service Provider ?
    This is not possible out of the box. You'll be able to do this with some custom code.

    Hello Jude !

    About this point, could you give me an hint of where to start ? Where I can customize the information and how to do it ?
    The best would be in the functions.php file of my theme !

    Thanks a lot,
    Regards,
    Guillaume

  • Sajid

    Hi @Guillaume,

    Hope you are doing good today :slight_smile:

    2) What I want to know, is if there is a way to send in the Appointment Confirmation mail the Bio of the Service Provider ?

    You can use "app_confirmation_message" filter to customize confirmation message, you can find this appointments.php file of plugin for more details and check what parameters it accepts.

    add_filter('app_confirmation_message', 'wpmudev_app_custom_message',10,2);
    function wpmudev_app_custom_message($r, $app_id){
    
    	$message = "YOUR MESSAGE GOES HERE";
    
    	return $message;
    
    }

    Add this code in functions.php file or use mu-plugin. In above filter "$r" is client object and "$app_id" is newly created appointment ID.

    Hope this helps :slight_smile:

    Cheers, Sajid

  • Guigro

    Thanks Sajid for this clue !

    It's really helping.

    I still have a few question to dig into this and be able to do everything by myself :

    1/ Is there somewhere a list of all mails sent from the plugin ? To be able to hook them all !

    2/ What I'm trying to do is to include a picture and a biography of my sales rep in my mails.
    To do that I need to get their ID, and to gather custom fields from their profile. I did it on my front-end, will need to put that in mails.
    I have two solutions : either I can get the $worker related to this appointment (in my opinion it's more safe), or I can get a custom field of my customer profil saying who is his dedicated Sales rep.

    3/ I can't get informations such as my client's name, the worker's name.

    I included that code for testing purpose :

    MAIL : ".$r->email."
    	client_phone = ".$r->phone."
    	client_name = ".$r->name."
    	service_name = ".$appointments->get_service_name( $r->service)."
    	worker_name = ".$appointments->get_worker_name( $r->worker)."
    	date_time = ".date_i18n( 'Y-m-d H:i:s', strtotime($r->start))."

    And it's giving me this in my mail :

    MAIL :
    client_phone =
    client_name =
    service_name = Not defined
    worker_name = Our Staff
    date_time = 2015-06-04 18:36:35

    Do you know how I can try to fix this ?

    Thanks a lot !
    Regards,
    Guillaume

  • Sajid

    Hi Guillaume! You are welcome :slight_smile:

    1/ Is there somewhere a list of all mails sent from the plugin ? To be able to hook them all !

    All emails sent to your customers will be though this function that you can hook easily. Is there any other transaction emails that you want to hook ?

    2/ What I'm trying to do is to include a picture and a biography of my sales rep in my mails.
    To do that I need to get their ID, and to gather custom fields from their profile. I did it on my front-end, will need to put that in mails.
    I have two solutions : either I can get the $worker related to this appointment (in my opinion it's more safe), or I can get a custom field of my customer profil saying who is his dedicated Sales rep.

    You can get the ID of service provider (if a service is set or a service provider is set) from appointment.
    $r->worker;
    This will return you the ID of service provider. To make sure, the ID is there you can have some checks and use a default service provider ID. Now you can get his information like picture, bio and include in confirmation message.

    3/ I can't get informations such as my client's name, the worker's name.

    If you its missing then you can get it from DB. I borrowed the code from appointments.php file.

    global $wpdb;
    		$r = $wpdb->get_row( $wpdb->prepare("SELECT * FROM {$this->app_table} WHERE ID=%d", $app_id) );

    There may be some issues to get the proper information, but I suggest you to keep testing that your previous information is correct. Most important part of this snippet are app ID and provider ID. So you have to make sure that the are correct and present.

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • Guigro

    Thanks for your complete answer !

    Unfortunately, when I add this line :

    global $wpdb;
    		$r = $wpdb->get_row( $wpdb->prepare("SELECT * FROM {$this->app_table} WHERE ID=%d", $app_id) );

    and ask for an appointments. When I want to confirm it from the back-end I get a unlimited rolling circle without the confirmation message.
    When I reload the page, the appointment is confirmed but there is not one mail sent.

    And with the $r -> worker value it gives me nothing, as with the $worker value.

  • Michelle Shull

    Hi, Guigro!

    Let's see if there's a particular PHP error being thrown here. Can you replace the current WP_DEBUG line(s) in your wp-config.php file with the lines below?

    // Enable WP_DEBUG mode
    define('WP_DEBUG', true);
    
    // Enable Debug logging to the /wp-content/debug.log file
    define('WP_DEBUG_LOG', true);
    
    // Disable display of errors and warnings
    define('WP_DEBUG_DISPLAY', false);
    
    @ini_set('display_errors',0);

    This will create a log file in your wp-content folder called debug.log. Run through the steps above where you got the loading error and no emails were sent, then refer to the log file to see if any PHP errors are happening we can track down.

    Thanks!

  • Guigro

    Thanks for this answer !

    Here are the three error I got from the debug.log file, two are related with Appointments +

    [12-Jun-2015 09:47:32 UTC] PHP Fatal error:  Using $this when not in object context in /var/www/vhosts/crayonclavier.com/dev.crayonclavier.com/sommelier3/wp-content/plugins/sommelier-particulier/sommelier-particulier.php on line 253
    [12-Jun-2015 09:47:47 UTC] PHP Notice:  wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.) in /var/www/vhosts/crayonclavier.com/dev.crayonclavier.com/sommelier3/wp-includes/functions.php on line 3560
    [12-Jun-2015 09:47:47 UTC] PHP Strict Standards:  Redefining already defined constructor for class AppointmentsGcal in /var/www/vhosts/crayonclavier.com/dev.crayonclavier.com/sommelier3/wp-content/plugins/appointments/includes/class.gcal.php on line 26

    The sommelier_particulier.php file is my personal plugin file where I put the code you gave me.
    Here is the line 253 :
    $r = $wpdb->get_row( $wpdb->prepare("SELECT * FROM {$this->app_table} WHERE ID=%d", $app_id) );

  • Sajid

    Hi @Guigro! Welcome back :slight_smile:

    I am sorry for terrible delay here. But yes I am back to hit this up :slight_smile:

    Can you please try this function instead of above code.

    add_filter('app_confirmation_message', 'wpmudev_app_custom_message',10, 3);
    function wpmudev_app_custom_message($message, $r, $app_id){
    
    	$message = "YOUR MESSAGE GOES HERE";
    
    	return $message;
    
    }

    I slightly modified the code and added default message of appointments+ , its $message. Every thing else is same what I described above.

    Please let me know if you are still getting empty emails ? If still not working. I then, will require FTP access to further investigate this issue and modify this file on your server. You can send me FTP and WordPress login details using our private contact form in following format.

    Subject: "Attn: Sajid Javed"
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me :slight_smile:

    https://premium.wpmudev.org/contact/

    Cheers, Sajid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.