23 — Email & SMS

Notifications, password reset, receipts

CEO Summary

Email and SMS power all outbound notifications: password reset, receipts, ticket notifications, appointment reminders. Business value: Customer communication, account recovery. Key metrics: Delivery rate, bounce rate. If this breaks: Users cannot reset password; receipts not sent; notifications fail.

Architecture

flowchart TB subgraph callers [Callers] Auth[auth - password reset] Rec[receipts] Tickets[tickets] Appt[appointments] end subgraph svc [Services] Mailer[mailer.js] MailSvc[email.service.js] SMS[sms.js] end subgraph providers [Providers] SMTP[SMTP/SendGrid] Twilio[Twilio] end Auth --> Mailer Rec --> Mailer Rec --> SMS Tickets --> Mailer Tickets --> SMS Appt --> Mailer Appt --> SMS Mailer --> SMTP MailSvc --> SMTP SMS --> Twilio

Overview

Email and SMS are infrastructure services. No dedicated routes — called by other services.

File Structure

backend/
├── services/
│   ├── mailer.js
│   └── email.service.js
└── sms.js
  # Or: backend/services/sms.js

Use Cases

Use CaseTriggerService
Password resetForgot password flowmailer.js
Receipt email/SMSPOS finalize, invoice paidreceipts.routes → sendMail, sendSms
Ticket notificationsticketNotification.servicemailer, sms
Appointment remindersAppointment booking/remindermailer, sms

Configuration

SMTP, SendGrid, or similar for email. Twilio or similar for SMS. Env vars for credentials (e.g. SMTP_HOST, TWILIO_ACCOUNT_SID).

Integration Points

SystemConnection
AuthPassword reset email
ReceiptsEmail/SMS receipt delivery
TicketsticketNotification.service
AppointmentsAppointment reminders

Key Paths

PathPurpose
backend/services/mailer.jssendMail
backend/sms.jssendSms