NateWr / restaurant-reservations

WordPress plugin to accept restaurant reservations online
68 stars 51 forks source link

Automatic reminders (enhancement) #113

Open Stoejfan opened 7 years ago

Stoejfan commented 7 years ago

It would be a great value adding feature with the possibility of sending out notification e-mails 24 hours before the reservation takes place in order to automatically notify customers of their reservations.

Furthermore, the ability to connect the plugin to a SMS to send out these notifications would increase the value of the plugin even more and take it to the next level.

Good job, none-the-less!

NateWr commented 7 years ago

Hi @Stoejfan!

Reminder and follow-up emails is one of the addons I've been planning to build for a while, I just haven't gotten a chance to build it yet. But I'd definitely like to get it out the door.

SMS is a little trickier. You'll need to pay a third-party provider to actually send out the SMS messages, and most of these providers offer an email-to-SMS service. I usually just recommend that people use this to send the admin notification emails on to their preferred SMS provider to fire off an SMS. I could build a specific integration that's a little neater, like with Twillio, it just hasn't been a big priority because there are existing workarounds that are almost as good.

rvpatel commented 7 years ago

Please provide a hook list where we can configured a SMS API integration.

NateWr commented 7 years ago

Hi @rvpatel,

Here's where each notification email is registered and filtered so that you can add new notifications:

https://github.com/NateWr/restaurant-reservations/blob/master/includes/Notifications.class.php#L63-L75

I'm instantiating new rtbNotificationEmail objects. These extend the base rtbNotification class which defines the execution structure of every notification:

https://github.com/NateWr/restaurant-reservations/blob/master/includes/Notification.class.php

The $event corresponds to one of the events fired by the plugin (when a booking request is made, confirmed or rejected):

https://github.com/NateWr/restaurant-reservations/blob/master/includes/Notifications.class.php#L47-L51

And the $target is used to configure the To/From headers:

https://github.com/NateWr/restaurant-reservations/blob/master/includes/Notification.Email.class.php#L79-L116