Skip to content

Issue #19 — Backend: Email Notification — Booking Cancelled #707

@yusuftomilola

Description

@yusuftomilola

Location:

  • backend/src/bookings/providers/cancel-booking.provider.ts
  • backend/src/email/email.service.ts
  • backend/src/email/templates/booking-cancelled.hbs

Description

When a booking is cancelled — whether by the member themselves or by an admin — the member should receive an email notifying them of the cancellation. The email should indicate who initiated the cancellation so the member has full context.

Acceptance Criteria

  • A Handlebars template is created at backend/src/email/templates/booking-cancelled.hbs displaying:
    • Member's full name
    • Booking ID
    • Workspace name
    • Original start date and end date
    • Who cancelled the booking ("you" if self-cancelled, "an administrator" if cancelled by admin)
  • A sendBookingCancelledEmail(to: string, fullName: string, data: {...}) method is added to EmailService
  • EmailService is injected into the cancel booking provider
  • After the booking status is saved as CANCELLED, the email is fired with .catch(() => void 0)
  • The cancel booking provider determines the cancelledBy value by comparing the requesting user's ID and role to the booking owner
  • npx tsc --noEmit passes with no errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions