mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-06 10:03:38 +00:00
feat: ( notifications ) send SMS and email for applied and expired reschedules and upgrades
This commit is contained in:
@@ -657,8 +657,70 @@ async function seedNotificationTemplates() {
|
||||
{ id: uuidv4(), code: 'payment.succeeded', channel: 'SMS', subject: 'Payment Received', bodyTemplate: 'Payment of {{amount}} {{currency}} received for booking {{bookingRef}}.' },
|
||||
{ id: uuidv4(), code: 'payment.failed', channel: 'SMS', subject: 'Payment Failed', bodyTemplate: 'Payment for booking {{bookingRef}} could not be completed. Please try again.' },
|
||||
{ id: uuidv4(), code: 'booking.cancelled', channel: 'EMAIL', subject: 'Booking Cancelled', bodyTemplate: 'Your booking {{bookingRef}} has been cancelled. Refund: {{refundAmount}} {{currency}}.' },
|
||||
{ id: uuidv4(), code: 'booking.rescheduled', channel: 'EMAIL', subject: 'Booking Rescheduled', bodyTemplate: 'Your {{leg}} journey on booking {{bookingRef}} has been rescheduled. New tickets have been issued. Change fee: {{feeAmount}} {{currency}}.' },
|
||||
{ id: uuidv4(), code: 'booking.upgraded', channel: 'EMAIL', subject: 'Fare Class Upgraded', bodyTemplate: 'Booking {{bookingRef}}: {{passengerSummary}} upgraded on your {{leg}} journey. New tickets have been issued. Paid: {{amountPaid}} {{currency}}.' },
|
||||
// Rich bodies mirroring booking.created: these are delivered by SMS *and* email, so the
|
||||
// wording has to stand alone in a text message. Channel is 'SMS,EMAIL' — the applied/expired
|
||||
// handlers deliver directly, but the field keeps the row honest about where it goes.
|
||||
{ id: uuidv4(), code: 'booking.rescheduled', channel: 'SMS,EMAIL', subject: 'Booking Rescheduled', bodyTemplate: `Dear {{passengerName}},
|
||||
|
||||
Your {{leg}} journey on booking ({{bookingRef}}) has been rescheduled.
|
||||
|
||||
Route: {{origin}} → {{destination}}
|
||||
{{trainSeatLines}}
|
||||
{{previousLine}}Travel Date: {{travelDate}}
|
||||
Departure: {{departureTime}}
|
||||
Arrival: {{arrivalTime}}
|
||||
|
||||
Paid: {{amountPaid}} {{currency}} (change fee: {{feeAmount}} {{currency}})
|
||||
New tickets have been issued.
|
||||
|
||||
View your booking: {{detailLink}}
|
||||
|
||||
Thank you for choosing EDR.` },
|
||||
{ id: uuidv4(), code: 'booking.upgraded', channel: 'SMS,EMAIL', subject: 'Fare Class Upgraded', bodyTemplate: `Dear {{passengerName}},
|
||||
|
||||
Your booking ({{bookingRef}}) has been upgraded on the {{leg}} journey.
|
||||
|
||||
Route: {{origin}} → {{destination}}
|
||||
{{changeLines}}
|
||||
Travel Date: {{travelDate}}
|
||||
Departure: {{departureTime}}
|
||||
|
||||
Paid: {{amountPaid}} {{currency}}
|
||||
New tickets have been issued.
|
||||
|
||||
View your booking: {{detailLink}}
|
||||
|
||||
Thank you for choosing EDR.` },
|
||||
{ id: uuidv4(), code: 'booking.reschedule.expired', channel: 'SMS,EMAIL', subject: 'Reschedule Request Expired', bodyTemplate: `Dear {{passengerName}},
|
||||
|
||||
Your reschedule request for booking ({{bookingRef}}) expired before it was paid, so it has not been applied.
|
||||
|
||||
The seat that was being held for it has been released. Your original booking, seats and travel date are unchanged:
|
||||
|
||||
Route: {{origin}} → {{destination}}
|
||||
{{trainSeatLines}}
|
||||
Travel Date: {{travelDate}}
|
||||
Departure: {{departureTime}}
|
||||
|
||||
You can start a new reschedule any time before check-in closes:
|
||||
{{detailLink}}
|
||||
|
||||
Thank you for choosing EDR.` },
|
||||
{ id: uuidv4(), code: 'booking.upgrade.expired', channel: 'SMS,EMAIL', subject: 'Upgrade Request Expired', bodyTemplate: `Dear {{passengerName}},
|
||||
|
||||
Your upgrade request for booking ({{bookingRef}}) expired before it was paid, so it has not been applied.
|
||||
|
||||
The seat that was being held for it has been released. Your original booking and seats are unchanged:
|
||||
|
||||
Route: {{origin}} → {{destination}}
|
||||
{{trainSeatLines}}
|
||||
Travel Date: {{travelDate}}
|
||||
Departure: {{departureTime}}
|
||||
|
||||
You can start a new upgrade any time before check-in closes:
|
||||
{{detailLink}}
|
||||
|
||||
Thank you for choosing EDR.` },
|
||||
// Templates below are not wired to handlers yet (Phase 2 — full event coverage).
|
||||
{ id: uuidv4(), code: 'trip.departure', channel: 'PUSH', subject: 'Trip Departing Soon', bodyTemplate: 'Your trip {{route}} departs in {{minutes}} minutes' },
|
||||
{ id: uuidv4(), code: 'trip.delay', channel: 'EMAIL', subject: 'Trip Delayed', bodyTemplate: 'Your trip {{route}} is delayed by {{delayMinutes}} minutes' },
|
||||
|
||||
Reference in New Issue
Block a user