-
Notifications
You must be signed in to change notification settings - Fork 12
Email notifications for locations, on bookings, cancellations, deletions, and when the location changes #172
Conversation
…rse email addresses (arbitrarily many), they don't need to be separated by comma or \n
…ut only ['contact']
…po` with currently in use file `languages/plugins/commons-booking-de_DE.po`
…o send booking confirmation email copies to the location
…t the public cb-bookings class send deletion emails
…on 2nd page) and print message
New update: Notification emails will also be sent when an admin deletes a booking from the booking table (only if the booking was not already canceled by the user and lies in the future). |
…e the bookings' location_id and send users notification emails
…mail template. Does not work yet: wrong base URL (permalink).
The email sending from the admin interface (bookings table) is done via the action API (see https://developer.wordpress.org/reference/functions/add_action/), so that the class in the 'admin' directory can access the existing email sending code in 'public/cb-bookings/class-cb-booking.php' in the 'public' directory. This avoids code duplication inside 'admin/cb-bookings/class-cb-bookings-table.php'. |
Another change (mainly commit 21dc7c8): When a timeframe is edited (or a new one is created and there are already overlapping bookings), it is checked if the location of existing bookings has changed. If so, the bookings' location_id is updated in the DB, so that the data stay intact (e.g. in the bookings table in the admin area). Notification emails about the change of their booking's location are sent to all users that have already booked (only if the booking's start date is today or lies in the future). Old and new location receive copies of the notification emails as well if they have the check box checked that they want to receive notification emails. |
This change makes it possible to offer bookings at a placeholder "fake" location. As soon as the actual location is known, an admin can change the timeframe's location to the real one (or delete the timeframe with the fake location and create a new one with the real location). All users that have already booked will be notified of the actual location. The location can receive copies and is therefore notified as well of who has already booked on which days. A problem might be existing bookings on days when the new location is closed. In this case, users should contact the item's location. |
Another use case is that a location cannot offer its services, e.g. due to illness, and the item must be relocated. With these changes, the plugin takes care of notifying all users of the change of the location. |
Locations can receive BCCs of confirmation emails sent to users when they book an item at the location. That way, locations can stay informed about who is coming on what day to fetch items.
Emails are sent to all email addresses found (by regex) in the contact details text field. The BCC sending is enabled by a checkbox below the contact details field in the location settings (below the "hide contact details" checkbox).
This fixes #143, #165 and a part of #77.