diff --git a/apps/Frontend/src/components/settings/ai-chat-templates-card.tsx b/apps/Frontend/src/components/settings/ai-chat-templates-card.tsx
index f08f1001..fbe48d30 100644
--- a/apps/Frontend/src/components/settings/ai-chat-templates-card.tsx
+++ b/apps/Frontend/src/components/settings/ai-chat-templates-card.tsx
@@ -19,23 +19,35 @@ type OfficeContact = {
officeName?: string | null;
};
+const SUPPORTED_SMS_VARS = [
+ "{firstName}", "{officeName}", "{appointmentDate}", "{appointmentTime}", "{date}", "{time}",
+] as const;
+
const DEFAULTS = {
reminderSms:
- "Hi {firstName}, this is a reminder from {officeName}. You have an appointment on {appointmentDate} at {appointmentTime}. Please come to our office at {officeAddress}. Please reply YES to confirm or NO to reschedule. Thank you!",
+ "Hi {firstName}, this is a reminder from {officeName}. You have an appointment on {appointmentDate} at {appointmentTime}. Please reply YES to confirm or NO to reschedule. Thank you!",
reminderGreeting:
- "Hi! My name is Lisa, the dedicated AI assistant at {officeName}. I can confirm or reschedule your appointment and answer general questions 24/7. I will reply you message at any time you need.",
+ "Hi! My name is Lisa, the dedicated AI assistant at {officeName}. I can confirm or reschedule your appointment and answer general questions 24/7. I will reply to your message at any time you need.",
newPatientGreeting:
"Hi! My name is Lisa, the dedicated AI assistant at {officeName}. I can help you schedule an appointment, check your insurance, and answer general questions 24/7. How can I help you today?",
generalFallback:
"Hi! My name is Lisa, the dedicated AI assistant at {officeName}. How can I help you today?",
rescheduleGreeting:
- "Hi! My name is Lisa, the dedicated AI assistant at {officeName}. I can help you find a new appointment time that works for you. Would you like to reschedule your appointment?",
+ "It is understandable! When would you like to reschedule your appointment?",
};
function preview(text: string, officeName: string) {
return text.replace(/\{officeName\}/g, officeName || "your dental office");
}
+/** Returns any {variable} tokens in `text` that are not in the supported list. */
+function unsupportedVars(text: string): string[] {
+ const found = text.match(/\{[^}]+\}/g) ?? [];
+ return [...new Set(found)].filter(
+ (v) => !(SUPPORTED_SMS_VARS as readonly string[]).includes(v)
+ );
+}
+
export function AiChatTemplatesCard() {
const { toast } = useToast();
@@ -115,7 +127,7 @@ export function AiChatTemplatesCard() {
key: "reminderSms" as const,
icon:
Loading templates...
) : (