Appointments+ SMS integration plugin enhanced!

Hello everyone! How is it going?

A few months back alot of people were asking if SMS integration can be done with the WPMU appointments+ plugin. I am happy to announce that we have made a plugin that extends the appointments+ plugin to integrate SMS notifications.
We currently have it working with Twilio and Clockwork SMS gateways.

These SMS notifications work if email notifications are enabled (as the plugin has hooks for email only).

Anyone who wants it please visit (my very recent and under development)website :
http://plugins.mindblaze.net/downloads/

You will need to register an account on the website and apply for a key.
:slight_smile:

  • Mindblaze
    • The Incredible Code Injector

    @Martin, I have responded to your email from the contact form :slight_smile:

    @Alexander, Most of the code is open for developers to see. Its just the MBT Key and one function that is obfuscated. I didn't want developers nullifying the MBT Key system that's why i had to obfuscate it. I am sure you can understand :wink:

  • David
    • Design Lord, Child of Thor

    @Mindblaze, looks very interesting, great work!

    Quick question - would the key allow me to use this on a multisite network? I have service providers but have gone down the road of giving them each an install of App+ on their subsite.

  • Mindblaze
    • The Incredible Code Injector

    Hi David, Thanks!

    The system works on multisite. I haven't tested it the way you are using Multisite App+ though. So you have to activate the plugin for each subsite?

    The key is domain based. So it should work without problems.

    I will however test it out when i get to office on monday. :slight_smile:

    P.S: Is your MU subdomain or subdirectory based ?

  • Mindblaze
    • The Incredible Code Injector

    Yeah there is no problem in that.

    In your current scenario, you will have to activate the appointments SMS plugin on each subsite too.

    Also the SMS gateway plugin (either twilio or clockworksms).

    2nd option is to enable the twilio or clockworksms on multisite network and keep only the appointments SMS on each subsite.

    In either case, the settings are saved on per site bases.

    The plugins uses the function update_site_option hook to save settings.

  • quentin_hello
    • WPMU DEV Initiate

    @Mindblaze,
    Just bought the Appointments+ SMS add-on,
    Got a problem : when clients receive the SMS Notification, they don't receive the SMS Text Value from the Plugin, but the Mail Text Value from Appointments+. Therefore they receive 4 truncked SMS.
    Any suggestions ?
    Best regards,
    Quentin.

  • Rob
    • Flash Drive

    Hello, I am considering this sms gateway plugin add-on for app+ used in a multisite subdomain situation.

    I will have several serv providers and customers. I can only use Twillio for my neck of the woods.
    Does anyone know how many telephone numbers I will require to rent form Twillio to send sms notification to all the various customer and serv providers? Or can it be done with just one number?
    Thx

  • Chris
    • Design Lord, Child of Thor

    This is a plugin for the Appointments Plugin?, but not made by wpmudev?

    This is pretty great, I can see my customers loving this feature as they'll be doing a lot of appointments plus all younger people who will certainly be big texters... but I'm concerned about this not being made and maintained, can anyone comment?

    Thanks!

  • Vaughan
    • Support/SLS MockingJay

    Hi chris,

    We have no control or association with this plugin, this means we can't guarantee anything related to it as it is out of our control.

    However Mindblaze is still an active member and i'm pretty sure as he uses our apps+ plugin itself, he will most likely also be keeping his excellent plugin up2date too, but you would need to direct support for that plugin itself to the developers site.

    Hope this helps

  • Mindblaze
    • The Incredible Code Injector

    Hi @Chris,

    We can see that you have a very valid concern. As vaughan said (thanks to vaughan bytheway :slight_smile: ) - We are an active member of the WPMU community. We have their yearly subscription for years now. We wrote that plugin because we ourselves wanted to use it. Appointments+ is a great plugin. We just extended it to support SMS as well without any alterations to the WPMU plugin.

    Regarding maintenance, yes we regularly update the plugin. However i must say, because so many people use it - we often are asked to add some specific functionality to it according to their business needs. For that we write additional code just for them and the main plugin remains the same. So its kinda like an addon for our plugin (which already is an addon of WPMU appointments+ plugin).

    We do provide support if our plugin does not work on your particular WP install.

  • Kieran
    • The Crimson Coder

    Hi Mindblaze,

    I have purchased your sms plugin and I'd like to request an upgrade if possible please. I'd like to select certain people / appointments to send a sms for please rather than everyone. Is it possible for me to tick a box in the appointment to send a confirmation or reminder by text message for that particular appointment rather than all appointments

    The reason being I don't want everyone having text messages just a handful of particularly forgetful clients

    I hope you can help!

    Kind Regards
    Kieran

  • Mindblaze
    • The Incredible Code Injector

    Hello everyone! I hope you guys are doing great!

    Recently one of our webserver was compromised so we had to take it down. That is the reason you guys get that 404 error. We are trying to restore the service but its taking us sometime. No one is running away with your money :slight_smile:

    We are really sorry for the inconvenience this has caused.

  • Milan
    • WordPress Wizard

    Hello @Mindblaze,

    I hope you are having a good day.

    Please let us know once you ready with extension. :slight_smile: Some of our member wants to use it but can't access it because you took it down. I completely understand its takes some time to relaunch service with better security. Just let us know once you ready with it. :slight_smile:

    Cheers.

  • Milan
    • WordPress Wizard

    Hello pageup ,

    Hope you are well today !

    If you mean with Appointments+ then sorry its not compatible but if you are talking about plugin which Mindblaze has created then I don't think he made it compatible with Twilio plugin. As far as I see, he made integration of Twilio gateway in his extension. :slight_smile:

    Cheers,
    Milan

  • Kasia Swiderska
    • Support nomad

    Hello ibroker,

    I'm afraid that Mindblaze account is at the moment inactive so they wont be able to answer that questions :slight_frown:
    As compatibility with last version of the App+ that would need to be tested. There was some changes since version 1.3 in plugin code.

    kind regards,
    Kasia

  • ibroker
    • Design Lord, Child of Thor

    Are there any plans to add SMS compatibility to the code? IT seems like WPMUDEV depended upon 3rd parties to provide this functionality, and it is a very popular request. Maybe time to bring it in-house using a service like Clickatell to provide that feature? Is that something you guys would consider? The world is moving more to SMS and for appointment reminders/confirms, it's really appreciated.

  • Adam Czajczyk
    • Support Gorilla

    Hello!

    There's no plans currently to add SMS reminders as a native feature to the Appointments+ plugin so I wouldn't expected that anytime soon but I fully agree that the idea sounds great. It seems it already got some significant support so I moved this thread to the "Features and Feedback" forum and hopefully it will give our developers an incentive to work on this. I'm not able to give you any ETA though.

    Best regards,
    Adam

  • KunSoren
    • Site Builder, Child of Zeus

    So I used the mindblaze plugin which worked partly for about 4 month and then it stopped completely after some appontment+ update.

    I guess in your newest updates you removed the items mindblaze hooked up with.

    I would like to make the function myself ASAP to share with my fellow wpmudevs, can you point me in direction how I can hook on SMS function for 1. Confirmation of booking 2. Reminders?

  • Michael
    • Site Builder, Child of Zeus

    Many of the major SMS providers have an email to SMS gateway. Mine does and this is what I used to integrate SMS with Appointments+ for my site. It seemed to be the most straightforward way of doing it.

    I'm running version 1.6 of Appointments+ so if you are on a newer version this code might need changing slightly, but here's what works for me. The following code snippets are saved as php files and uploaded to my site as mu-plugins. I have SMS confirmation for new bookings and SMS reminders, both are sent out at the same time as the confirmation and reminder emails generated by the plugin.

    New booking SMS

    <?php 
    
    add_action( 'app_confirmation_sent', 'app_confirmation_sent_sms', 20, 3 );
    function app_confirmation_sent_sms( $body, $r, $app_id ) {
    
    	$myphone = preg_replace('/\D/', '', $r->phone);
    	$date = mysql2date( 'H:i', $r->start ) . ' - ' . mysql2date( 'H:i', date( 'Y-m-d H:i:s', strtotime( '+1 hour', strtotime( $r->start ) ) ) ) . ' on ' . mysql2date( 'd M', $r->start );
    	$to = '' . $myphone . '@smsgateway.com'; // Change this to match your SMS gateway email address
    	$body = "Booking confirmed, we have sent full details to $r->email We will be with you between $date"; // Customise this text to suit you.
    	wp_mail( $to, '', $body);
    
    }

    SMS reminder

    <?php 
    
    add_action( 'app_reminder_message', 'app_reminder_sent_sms', 20, 3 );
    function app_reminder_sent_sms( $body, $r, $app_id ) {
    
    	$first_name = $r->name;
    	$first_name = ucwords(strtolower($first_name));
    	$first_name = preg_split('/ /', $first_name, 2);
    	$newname = $first_name['0'];
    	$myphone = preg_replace('/\D/', '', $r->phone);
            $to = '' . $myphone . '@smsgateway.com'; // Change to match your SMS gateway
    	$date = mysql2date( 'H:i', $r->start ) . ' - ' . mysql2date( 'H:i', date( 'Y-m-d H:i:s', strtotime( '+1 hour', strtotime( $r->start ) ) ) );
    	$emailbody = "Hi $newname this is a reminder for your booking tomorrow. We will be with you between $date"; // Customise this to suit you
    	wp_mail($to,'',$emailbody);
    	return $body;
    }
    • Willi
      • Flash Drive

      I have used the php code supplied above by Michael and modified with a working email to sms gateway address to create MU plugins, which are being displayed in the list on my site, but am not getting an sms when the standard email is sent. I'm assuming it is because the email to the gateway is not being sent.

      Can one of the WPMUDEV developers please check the code to see if it still refers to the right stuff in the plugin?

      My site is live at (http://studioms.com.au/)103.42.110.10, to see it you'll need to add the below entries to your hosts file:
      103.42.110.10 http://www.studioms.com.au
      103.42.110.10 studioms.com.au

  • Kieran
    • The Crimson Coder

    Hey,

    Thanks for sharing. Would it be possible to tweak the code so it only sent text messages for certain users? Either I could manually add the user profile number or via the creation of an additional field in the user profile to select yes/no for text reminders.

    Seems better than mass emails. What do you think?

    For those added via the backend it could be on or off by default.

    Kind Regards
    Kieran

  • Michael
    • Site Builder, Child of Zeus

    If you add the following code after the first { in each snippet:

    global $wpdb;
    $results = $wpdb->get_results( "SELECT * FROM wp_app_appointments WHERE ID = '$app_id'", ARRAY_A );

    you can now get the user ID of whoever made the appointment using the variable
    $results['0']['user']
    So you could manually add a list of users who you wanted to get SMS updates with an if statement

    if ($results['0']['user'] == '1' || $results['0']['user'] == '2' || $results['0']['user'] == '3') {
    // SMS code goes here
    }

    This is going to get messy once you start adding more than a few users to the list, probably better to add an extra option in the user profile and check the value with get_user_meta for your IF statement.

    Personally I don't bother. I have a couple of extra lines of code to only send SMS to numbers starting 07 (UK mobiles) but that's it. I often get positive feedback from customers about the SMS confirmations so I send them to everyone. I pay about 2p each, so no need to try and economise.

  • Kasia Swiderska
    • Support nomad

    Hello,

    Got this from developer if someone wants to try different actions.

    do_action( 'wpmudev_appointments_update_appointment_status', $app_id, $new_status, $old_status );
    `

    this is action when appointment changes status.There is no similar action for reminders but there is filter:

    $body = apply_filters( 'app_reminder_message', $body, $r, $r->ID );

    with this remember to return the body, this is a filter, not an action.

    kind regards,
    Kasia

    • Rupok
      • Support Ninja

      Hi claudia,

      Are you asking about the update of our Appointment+ plugin or the plugin user shared? If about the plugin user shared, I'm afraid, we don't maintain that and can't confirm updates.

      Regarding Appointments+, our developers are continuously working and they will release an update when they are done testing with the next version.

      Have a nice day. Cheers!
      Rupok

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.