This document provides a comprehensive list of all automated SMS notifications sent through Twilio within the application.
- File:
src/services/notificationService.js - Function:
sendText - Purpose: To send promotional or informational messages in bulk to customers who have recently signed up.
- Recipient: New customers.
- Message: The content of the message is dynamic and passed as an argument to the function.
- File:
src/services/jobsService.js,src/routes/jobs.js,src/controllers/jobsController.js - Triggers & Purpose:
- Technician Assigned: When a technician is assigned to a job, the customer receives a confirmation text.
- Message: "Thank you for trusting 24 Hour Car Unlocking. A technician has been dispatched to your location. Please wait for the technician to arrive. If needed, you can call your technician at {proxyNumber}."
- Technician En Route: When the technician is on their way, the customer is notified.
- Message: "Your technician, {technicianFirstName}, is on their way. If needed, you can call them at {proxyNumber}. Track job status: {trackingUrl}"
- Job Completed: After the job is finished, the customer receives a confirmation and a link to their invoice.
- Message: "{customerFirstName}, thanks for trusting 24hr Car Unlocking. Your invoice is ready to view: {invoiceLink}. Book 24/7: 24hrcarunlocking.com/book. In an Emergency Call Us: (866) 584-8488"
- Review Request: After the job is completed, the customer is asked to leave a review.
- Message: "{customerFirstName}, thanks for trusting 24hr Car Unlocking. We'd love your feedback, Let us know how {technicianFirstName} did: {googleReviewLink}. Book 24/7: 24hrcarunlocking.com/book. In an Emergency Call Us: (866) 584-8488"
- Technician Assigned: When a technician is assigned to a job, the customer receives a confirmation text.
- File:
src/services/jobsService.js,src/routes/jobs.js - Triggers & Purpose:
- Job Link: When a job is assigned to a technician, they receive a direct link to the job details.
- Message: "Hello {technicianFirstName}, here is your link for J-{jobId}: {jobLink}"
- Job Dispatch Reminder: If a technician doesn't respond to a dispatch call, they receive a text reminder.
- Message: "You have a job waiting for you. Please accept or decline in the next {retryMinutes} minutes. {jobAcceptLink}"
- Job Details (IVR Acceptance): After accepting a job via the IVR, the technician receives a link to the job details.
- Message: "Job details: {jobDetailsLink}"
- Job Link: When a job is assigned to a technician, they receive a direct link to the job details.
- File:
src/services/flows/ivrForm.js - Triggers & Purpose:
- New IVR Lead: Notifies dispatchers when a new lead is generated through the IVR.
- Recipient: Dispatcher
- Message: "A new call lead has arrived from the IVR form. ({customerPhoneNumber})"
- IVR Call Completed: Notifies dispatchers when a customer finishes or hangs up during the IVR process.
- Recipient: Dispatcher
- Message: "A customer has completed IVR form or possibly hung up. To verify details, contact the customer at {customerPhoneNumber}"
- Inbound Text Forwarding: Forwards incoming text messages to the appropriate internal contact.
- Recipient: User or phone number based on configuration.
- Message: "({fromNumber}) {messageBody}"
- New IVR Lead: Notifies dispatchers when a new lead is generated through the IVR.
- File:
src/routes/users.js - Function:
/users/otp/request - Purpose: To send a one-time password (OTP) to a user for account verification or password reset.
- Recipient: User requesting OTP.
- Message: "Here is your one time password {otp}"
- File:
src/routes/form-submission.js - Trigger: A customer successfully submits a form and provides SMS consent.
- Purpose: To confirm receipt of the customer's submission.
- Recipient: Customer who submitted the form.
- Message: "Thank you for choosing 24hr Car Unlocking! Your request has been received, and a representative will contact you shortly to confirm your service appointment."
- File:
src/controllers/invoiceController.js - Function:
sendInvoice - Purpose: To send a direct link to a customer's invoice via text.
- Recipient: Customer associated with the invoice.
- Message: "Your invoice from 24hr Car Unlocking is ready: {invoiceLink}"
- File:
src/routes/webhooks.js - Trigger: An SMS message fails to send due to a carrier violation (Error 30034).
- Purpose: To automatically retry sending the failed message.
- Recipient: The original intended recipient of the failed SMS.
- Message: The original message content is resent. This process is attempted up to 7 times with increasing delays.