Workflow Notifications
Notifications in the Adamondo backend are triggered by workflow transitions (reservations, document approvals, etc.).
[!NOTE] All notification side effects are non-blocking and executed after the transaction commits. Failure to send a notification will not roll back the database transaction.
Reservation Workflow Notifications
| Action | Host Notification | Guest Notification |
|---|---|---|
| inquiry | Push: New Inquiry - "You have received a new inquiry." Email: Template type inquirySocket: New Inquiry - "You have a new inquiry" | Push: New Inquiry Sent - "Your inquiry has been sent to the host." Email: Template type bookingRequestGuestSocket: New Inquiry - "You have sent a new inquiry" |
| preApproved | Push: Request Pre-Approved - "You have pre-approved the booking request." Socket: Pre-Approved - "You have pre-approved the request" | Push: Request Pre-Approved - "Your booking request has been pre-approved!" Email: Template type bookingPreApprovalSocket: Pre-Approved - "Your booking request is pre-approved" |
| declined | Push: Request Declined - "You have declined the booking request." Socket: Declined - "You declined the request" | Push: Request Declined - "Your booking request has been declined." Email: Template type bookingDeclinedToGuestSocket: Declined - "Your request was declined" |
| paid | Push: New Booking Confirmed - "A guest has confirmed a booking." Email: Template type bookingConfirmedToHostSocket: Booking Confirmed - "A new booking has been confirmed" | Push: Booking Confirmed - "Your booking is confirmed!" Email: Template type bookingConfirmedToGuestSocket: Booking Confirmed - "Your booking is confirmed" |
| cancelledByGuest | Push: Reservation Cancelled - "Guest has cancelled the reservation." Email: Template type cancelledByGuestSocket: Cancelled - "Guest cancelled the reservation" | Push: Reservation Cancelled - "You have cancelled your reservation." Socket: Cancelled - "You cancelled the reservation" |
| cancelledByHost | Push: Reservation Cancelled - "You have cancelled the reservation." Socket: Cancelled - "You cancelled the reservation" | Push: Reservation Cancelled - "Host has cancelled the reservation." Email: Template type cancelledByHostSocket: Cancelled - "Host cancelled the reservation" |
| expired | Push: Request Expired - "A booking request has expired." Email: Template type bookingExpiredHostSocket: Expired - "Request expired" | Push: Request Expired - "Your booking request has expired." Email: Template type bookingExpiredGuestSocket: Expired - "Request expired" |
| complete | ... (same as above) ... | |
| issue_claim | ... | |
| escalate_claim | ... |
Document Approval Workflow Notifications
| Action | Owner Notification | Admin Notification |
|---|---|---|
| submit | Push: Document Submitted Socket: DOCUMENT_SUBMITTED | Push: New Document to Review Email: Template adminDocumentReviewSocket: DOCUMENT_SUBMITTED |
| resubmit | Push: Document Resubmitted Socket: DOCUMENT_SUBMITTED | Push: Document Resubmitted Email: Template adminDocumentReviewSocket: DOCUMENT_SUBMITTED |
| approve | Push: Document Approved! Email: Template documentVerificationSocket: DOCUMENT_APPROVED | — |
| requestChanges | Push: Changes Requested Email: Template documentVerificationSocket: DOCUMENT_CHANGES_REQUESTED | — |
Debugging and Simulation
You can simulate notifications and view the generated email HTML in development:
- Reservations:
POST /debug/simulate-reservation-notifications/:threadId - Documents:
POST /debug/simulate-document-notifications/:documentId
To generate a full set of simulation files for both workflows, run:
yarn workspace @adamondo/backend generate:docs:notifications
The output is saved to ./email-simulations/ in the backend root.