Skip to content

Issue #18 — Backend: Email Notification — Booking Created #708

@yusuftomilola

Description

@yusuftomilola

Location:

  • backend/src/bookings/providers/create-booking.provider.ts
  • backend/src/email/email.service.ts
  • backend/src/email/templates/booking-created.hbs

Description

When a member successfully creates a booking, they should receive an email confirmation with all the relevant details. The EmailModule is already set up in the project and is globally available — no new module imports are needed. The email should fire asynchronously after the booking is saved so it never blocks the HTTP response.

Acceptance Criteria

  • A Handlebars template is created at backend/src/email/templates/booking-created.hbs with a clean layout displaying:
    • Member's full name
    • Booking ID
    • Workspace name
    • Plan type (Hourly / Daily / Monthly)
    • Start date and end date (human-readable format)
    • Number of seats
    • Total amount in Naira (converted from kobo)
  • A sendBookingCreatedEmail(to: string, fullName: string, data: {...}) method is added to EmailService that uses the template above
  • EmailService is injected into the create booking provider
  • After the booking is saved, the email is fired with .catch(() => void 0) so failures are silent and non-blocking
  • The User entity is loaded (or its data extracted) within the create booking provider to obtain the member's email and full name
  • 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