OI
owner-quotes

SMS Templates

All SMS messages and OTP verification flows sent via Twilio.

All SMS Templates

Booking Confirmation SMS

After booking

Message

Hi {firstName}! Your {serviceName} booking at {address} has been received. Preferred date: {tentativeDate}. We'll be in touch to confirm your appointment. — Owner Inspections

Endpoint: POST /api/sms/booking

Rate Limit: Per phone via rateLimitGuard

Notes: Date line only included if tentativeDate is provided.

Quote Follow-Up SMS

Auto: 5min + 24hr after quote

Message

Hi {firstName}! Your inspection quote is ${payablePrice} incl. GST. Accept & pay here: {quotePageUrl} — Owner Inspections

Endpoint: POST /api/sms/followup

Rate Limit: Per phone via rateLimitGuard

Notes: Auto-triggered by QuoteFollowUp durable object in owner-api: first at 5 minutes after quote generated, then again at 24 hours. URL shortened by Twilio (ShortenUrls: true).

Booking Reminder SMS

Auto: 10min + 24hr after payment

Message

Hi {firstName}! You've paid for your {serviceName} inspection but haven't completed the booking form yet. Book here: {bookingUrl} — Owner Inspections

Endpoint: POST /api/sms/booking-reminder

Rate Limit: Per phone via rateLimitGuard

Notes: Auto-triggered by BookingFollowUp durable object in owner-api: first at 10 minutes after payment with no booking, then again at 24 hours. URL shortened by Twilio.

Auto-Trigger Flow (owner-api Durable Objects)

The follow-up and reminder SMS are triggered automatically by Cloudflare Durable Objects in the owner-api project:

QuoteFollowUp After a quote is generated → waits 5 min → sends follow-up email + SMS → waits 24hr → resends if not paid.

BookingFollowUp After payment received → waits 10 min → sends booking reminder email + SMS → waits 24hr → resends if booking not completed.

Both durable objects call the owner-quotes SMS endpoints internally.

OTP Verification

Provider: Twilio Verify service sends 6-digit OTP codes via SMS.

Send Endpoint: POST /api/twilio/send-otp

Verify Endpoint: POST /api/twilio/verify-otp

Rate Limiting: 5 OTP requests per IP per 10 minutes, 5 per phone per 10 minutes.

Test Bypass: Hardcoded test phone numbers can use code 123456.

Test Phones: +61413678805, +61483916555, +61483982777, +61482088564, +61482093666, +61483917100, +61483936333

Phone Format: Australian numbers auto-converted: 0413 678 805+61413678805. Validates E.164 format.

Configuration

VariablePurpose
TWILIO_ACCOUNT_SIDAccount identifier
TWILIO_AUTH_TOKENAuthentication token
VERIFY_SERVICE_SIDOTP verification service
TWILIO_MESSAGING_SERVICE_SIDSMS messaging service