Booking cancellations

Created on 29 May 2024, 9 months ago

Problem/Motivation

When someone makes a booking, it happens from time to time that customers want to cancel it.
By implementing the following process, we would simplify booking cancellations, reduce manual intervention, and empower users to manage their reservations efficiently.

Proposed resolution

When a user makes a booking, the system automatically generates a simple unique hash.
This hash is associated with the booking details (e.g., submission ID, date, etc.).

Sending a Confirmation Email:

After a successful booking, the module sends the user a confirmation email.
The email includes the unique hash as part of the cancellation link.

Cancellation Process:

When a user wants to cancel their booking, they click on the cancellation link.
The link directs them to a specific URL (e.g., https://yourwebsite.com/cancel?hash=unique_hash).

Module Handling:

Upon accessing the cancellation link, a function extracts the hash from the URL and looks up the booking associated with that hash.
Relevant information (such as booking details) is displayed to the user.
A confirmation button for cancellation is provided.

Email Notification:

The system sends an email to the user to confirm the cancellation.
In this email, we need a link with a more complex Hash (e.g., using a secure hashing algorithm like SHA-256) This Link should have an expiration time for added security as well.

Cancellation Confirmation:

If the user confirms the cancellation, we mark or delete the booking from the submissions.
The booking slot becomes available for others to use.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany hewi1345 Flensburg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @hewi1345
  • 🇩🇪Germany Sajara

    This feature is of very high importancy for me, too (busyness use). please put an eye on it.

  • 🇩🇰Denmark ressa Copenhagen

    @Sajara: Remember that Drupal is open source, and run by volunteers, offering their time and services for free.

    You and @hewi1345 could consider sponsoring @rfmarcelino to build this feature?

  • 🇵🇹Portugal rfmarcelino

    Dear @hewi1345 @Sajara
    Thank you for your feedback.
    There are several implications to consider.
    The email content usually needs to be customised and a generic solution may not work well for most use cases.
    The simplest approach, since Webform already allows to configure emails, would be to provide a token for the cancellation URL.
    That would allow to embed inside a custom confirmation email.
    A controller would get that cancellation request and remove the value from the submission.
    Currently, the cancellation is deleting the field content. In terms of auditing, it's not great. It would be probably better to have a hidden 'Canceled' status.

    As @ressa just mentioned, we are volunteering our time. We have a set of weekly contribution hours. If you need a specific feature within a specific timeframe, feel free to reach us.

  • 🇦🇹Austria electric.larry Vienna

    Now, as we introduced tokens in webform_booking 1.1.4 and submission objects can already create hashes (?token=****) that allow for viewing/updating/deleting submissions, we basically have all we need for the cancellation feature.

    @rfmarcelino: In #4, you said: "Currently, the cancellation is deleting the field content.
    Is there some cancellation feature in webform_booking already, or are you referring to the built-in functions for editing/updating submissions (webform_submission:token-delete-url, webform_submission:token-update-url)?

    Also, in #4, you said: "In terms of auditing, it's not great. It would be probably better to have a hidden 'Canceled' status."
    I'm wondering how you'd prefer approaching this. In webform_submission_data, we're saving a value like "2025-01-07 09:00|1" for one booked slot on the 7th. Would you rather just update the value to "2025-01-07 09:00|0" when a user clicks the cancel link, or do you think it would be better to change the value to something like "2025-01-07 09:00|1|cancelled"? Or did you have something completely different in mind for the hidden canceled status?

  • Merge request !10#3450608 - Booking cancellations → (Closed) created by Unnamed author
  • 🇦🇹Austria electric.larry Vienna

    This patch adds the requested cancellation feature.

    A new token is available [webform_submission:booking:element_key:cancel_link] that can be placed on the confirmation page or popup. Replace element_key with the machine name of the Webform Booking field. In this example my form has two Webform Booking fields named appointment_booking and appointment_2.

    Confirmation page source

    Confirmation page display

    If you have more than one Webform Booking fields on your form, only place one cancel link on the cofirmation page. Opening the link displays a list of all Webform Booking fields in that submission and allows the user to select the bookings he wants to cancel.

  • 🇦🇹Austria electric.larry Vienna

    The patch in #9 also fixes another issue with creation of tokens if multiple Webform Booking fields are placed on a form and one of them is submitted empty.

  • Merge request !13Resolve #3450608 "Booking cancellations" → (Closed) created by Unnamed author
  • 🇵🇹Portugal rfmarcelino

    Thank you @electric.larry, for your contributions!
    Committed!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024