Public: anyone can read this; the crew can change it.
Follow-ups speak to what each lead asked about #41
Check · Review · Land · Live done — Landed and live in production.
mason/speed-to-lead:mason/9-follow-ups-speak-to-what-each-lead-asked → main 1 commit fork
2 files
changed +134
−16
src/drafts.test.ts +40
| @@ -46,3 +46,43 @@ test("every signature names the agent, the brokerage and the license", () => { | ||
| 46 | 46 | expect(s).toContain(part); |
| 47 | 47 | } |
| 48 | 48 | }); |
| 49 | ||
| 50 | const TOPIC_MESSAGES = { | |
| 51 | showing: "Can I tour 92 Harbor View Dr this week?", | |
| 52 | selling: "What's my condo worth?", | |
| 53 | financing: "Pre-approved up to $550k.", | |
| 54 | relocating: "We are relocating from Denver.", | |
| 55 | first_time: "We are first-time buyers.", | |
| 56 | price: "Are the sellers flexible on price?", | |
| 57 | general: "Tell me more please.", | |
| 58 | } as const; | |
| 59 | ||
| 60 | test("every topic and day has a short draft by name that differs from the general one", () => { | |
| 61 | for (const [topic, message] of Object.entries(TOPIC_MESSAGES)) { | |
| 62 | expect(topicOf(message)).toBe(topic); | |
| 63 | for (const consent of [true, false]) | |
| 64 | for (const day of [0, 1, 3, 7, 14, 30]) { | |
| 65 | const l = { ...lead, message, consent }; | |
| 66 | const text = draft(l, day, agent); | |
| 67 | expect(text).toContain("Hi Aisha"); | |
| 68 | if (consent) { | |
| 69 | expect(text.length + signature("text", agent).length).toBeLessThan(480); | |
| 70 | } else if (day > 0) { | |
| 71 | expect(text).toEndWith("Best,"); | |
| 72 | } | |
| 73 | if (topic !== "general") | |
| 74 | expect(text).not.toBe(draft({ ...l, message: TOPIC_MESSAGES.general }, day, agent)); | |
| 75 | expect(text).not.toMatch(/\$\d|\b\d{1,2}(:\d\d)?\s?(am|pm)\b/i); | |
| 76 | } | |
| 77 | } | |
| 78 | }); | |
| 79 | ||
| 80 | test("the address they asked about is in the showing touch; the price reply offers something", () => { | |
| 81 | const l = { ...lead, message: TOPIC_MESSAGES.showing, consent: true }; | |
| 82 | expect(draft(l, 3, agent)).toContain("92 Harbor View Dr"); | |
| 83 | expect(draft(l, 3, agent)).toContain("similar homes nearby"); | |
| 84 | expect(draft({ ...l, message: TOPIC_MESSAGES.price }, 0, agent)).not.toContain("let me find out"); | |
| 85 | expect(draft({ ...l, message: TOPIC_MESSAGES.price }, 0, agent)).toContain("sold"); | |
| 86 | expect(draft({ ...l, message: TOPIC_MESSAGES.financing }, 3, agent)).toContain("lender"); | |
| 87 | expect(draft({ ...l, message: TOPIC_MESSAGES.relocating }, 7, agent)).toContain("neighborhood rundown"); | |
| 88 | }); |
src/drafts.ts +94 −16
| @@ -120,8 +120,8 @@ function ask(topic: Topic, address: string | undefined, short: boolean): string | ||
| 120 | 120 | : "I work with first-time buyers all the time, and I'd love to walk you through how it all works, start to finish. Would a 15-minute call this week work for you?"; |
| 121 | 121 | case "price": |
| 122 | 122 | return short |
| 123 | ? "Good question — let me find out and get back to you today." | |
| 124 | : "Good question — let me find out what I can and get back to you today. In the meantime, would you like to see it again, or a few similar homes nearby?"; | |
| 123 | ? "Good question — I can send what similar homes nearby recently sold for, or we can talk it through. Which helps more?" | |
| 124 | : "Good question. I can send you what similar homes nearby have recently sold for, which shows how much room there may be, or we can talk it through by phone. Which would help more?"; | |
| 125 | 125 | case "general": |
| 126 | 126 | return short |
| 127 | 127 | ? "I'd love to help. When's a good time for a quick call?" |
| @@ -129,19 +129,96 @@ function ask(topic: Topic, address: string | undefined, short: boolean): string | ||
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | const TOUCH: Readonly<Record<number, (first: string, topic: Topic) => string>> = { | |
| 133 | 1: (first) => | |
| 134 | `Hi ${first}, just following up on my note yesterday. Happy to work around your schedule — what times are good for you?`, | |
| 135 | 3: (first, topic) => | |
| 136 | topic === "selling" | |
| 137 | ? `Hi ${first}, homes near you have been moving quickly this week. Would you like to see what sold nearby, and for how much?` | |
| 138 | : `Hi ${first}, a few new homes came on the market this week that might be a fit. Would you like me to send them over?`, | |
| 139 | 7: (first) => | |
| 140 | `Hi ${first}, I know things get busy. If now isn't the right time, no problem at all — just tell me when to check back.`, | |
| 141 | 14: (first) => | |
| 142 | `Hi ${first}, still here whenever you're ready. Is there anything I can look into for you — a neighborhood, a price range, a question about the process?`, | |
| 143 | 30: (first) => | |
| 144 | `Hi ${first}, it's been about a month, so I wanted to check in once more. If your plans have changed, I'd still be glad to help whenever the time is right.`, | |
| 132 | type Touch = (first: string, address: string | undefined) => string; | |
| 133 | ||
| 134 | const hi = (first: string, rest: string): string => `Hi ${first}, ${rest}`; | |
| 135 | ||
| 136 | /** | |
| 137 | * What each touch of the cadence says, by what the lead asked about. A topic | |
| 138 | * with no wording for a day falls back to `general`. Nothing here promises a | |
| 139 | * time or a price, and every line is short enough to text. | |
| 140 | */ | |
| 141 | const TOUCH: Readonly<Record<number, Readonly<Record<Topic, Touch>>>> = { | |
| 142 | 1: { | |
| 143 | general: (f) => | |
| 144 | hi(f, "just following up on my note yesterday. Happy to work around your schedule — what times are good for you?"), | |
| 145 | showing: (f, a) => | |
| 146 | hi(f, `just following up on ${a ?? "the home"}. Happy to work around your schedule — what day is best for a visit?`), | |
| 147 | selling: (f) => | |
| 148 | hi(f, "just following up on your home. A short visit is all I need to give you a real picture of its value — what day suits you?"), | |
| 149 | financing: (f) => | |
| 150 | hi(f, "just following up. Once I know the neighborhoods you like, I can line up homes that fit your budget — which areas are you eyeing?"), | |
| 151 | relocating: (f) => | |
| 152 | hi(f, "just following up on your move. Happy to work around your schedule for a call — what times are good for you?"), | |
| 153 | first_time: (f) => | |
| 154 | hi(f, "just following up. No question is too basic for a first purchase — what's on your mind so far?"), | |
| 155 | price: (f) => | |
| 156 | hi(f, "just following up on your question about price. I can share what similar homes nearby have sold for — would that help?"), | |
| 157 | }, | |
| 158 | 3: { | |
| 159 | general: (f) => | |
| 160 | hi(f, "a few new homes came on the market this week that might be a fit. Would you like me to send them over?"), | |
| 161 | showing: (f, a) => | |
| 162 | hi(f, `still happy to show you ${a ?? "the home"}. I also found similar homes nearby that you might like to see on the same visit — shall I send them?`), | |
| 163 | selling: (f) => | |
| 164 | hi(f, "homes near you have been moving quickly this week. Would you like to see what sold nearby, and for how much?"), | |
| 165 | financing: (f) => | |
| 166 | hi(f, "if it would help, I can introduce you to a lender my clients trust, so you know your numbers before you tour. Want me to connect you?"), | |
| 167 | relocating: (f) => | |
| 168 | hi(f, "a few homes came on the market this week in areas that suit newcomers. Would you like me to send them, with a note on each area?"), | |
| 169 | first_time: (f) => | |
| 170 | hi(f, "a few new homes came on the market this week that suit a first purchase. Want me to send them, with a plain-English guide to the steps?"), | |
| 171 | price: (f) => | |
| 172 | hi(f, "I pulled together recent sales near the home you asked about, so you can see how it compares. Would you like them?"), | |
| 173 | }, | |
| 174 | 7: { | |
| 175 | general: (f) => | |
| 176 | hi(f, "I know things get busy. If now isn't the right time, no problem at all — just tell me when to check back."), | |
| 177 | showing: (f, a) => | |
| 178 | hi(f, `I know things get busy. If ${a ?? "the home"} isn't the right one, I can look for others like it — just tell me what to change.`), | |
| 179 | selling: (f) => | |
| 180 | hi(f, "I know things get busy. Whenever you're curious what your home would sell for, a free estimate is one short visit away."), | |
| 181 | financing: (f) => | |
| 182 | hi(f, "I know things get busy. Getting pre-approved first makes everything easier — I'm happy to point you to a lender, no obligation."), | |
| 183 | relocating: (f) => | |
| 184 | hi(f, "I know a move is a lot. I can put together a neighborhood rundown — commutes, schools and feel — if that would help you narrow it down."), | |
| 185 | first_time: (f) => | |
| 186 | hi(f, "I know things get busy. If it helps, I can send a short checklist of what to expect from first look to closing."), | |
| 187 | price: (f) => | |
| 188 | hi(f, "I know things get busy. When you're ready, I can walk you through how offers and negotiation usually work on a home like that."), | |
| 189 | }, | |
| 190 | 14: { | |
| 191 | general: (f) => | |
| 192 | hi(f, "still here whenever you're ready. Is there anything I can look into for you — a neighborhood, a price range, a question about the process?"), | |
| 193 | showing: (f, a) => | |
| 194 | hi(f, `still here whenever you're ready. Should I keep an eye out for homes like ${a ?? "the one you asked about"}, or would a different area suit you better?`), | |
| 195 | selling: (f) => | |
| 196 | hi(f, "still here whenever you're ready. Is there anything I can look into for you — recent sales on your street, or what to fix before listing?"), | |
| 197 | financing: (f) => | |
| 198 | hi(f, "still here whenever you're ready. Have you had a chance to talk to a lender? I'm glad to answer questions about what to expect."), | |
| 199 | relocating: (f) => | |
| 200 | hi(f, "still here whenever you're ready. Is there an area or a school question I can look into for your move?"), | |
| 201 | first_time: (f) => | |
| 202 | hi(f, "still here whenever you're ready. Is there a part of the process I can explain — offers, inspections, or closing costs?"), | |
| 203 | price: (f) => | |
| 204 | hi(f, "still here whenever you're ready. Should I send recent sales nearby, or keep watching for price changes on homes you like?"), | |
| 205 | }, | |
| 206 | 30: { | |
| 207 | general: (f) => | |
| 208 | hi(f, "it's been about a month, so I wanted to check in once more. If your plans have changed, I'd still be glad to help whenever the time is right."), | |
| 209 | showing: (f) => | |
| 210 | hi(f, "it's been about a month since you asked about a home. If you're still looking, I'd be glad to set up a visit whenever the time is right."), | |
| 211 | selling: (f) => | |
| 212 | hi(f, "it's been about a month, so I wanted to check in once more. If you're still thinking about selling, your free estimate is ready whenever you are."), | |
| 213 | financing: (f) => | |
| 214 | hi(f, "it's been about a month, so I wanted to check in once more. If you're still planning to buy, I'm glad to pick up where we left off."), | |
| 215 | relocating: (f) => | |
| 216 | hi(f, "it's been about a month, so I wanted to check in once more. If your move is still on, I'd be glad to help whenever the time is right."), | |
| 217 | first_time: (f) => | |
| 218 | hi(f, "it's been about a month, so I wanted to check in once more. When you're ready to start, I'd be glad to walk you through it."), | |
| 219 | price: (f) => | |
| 220 | hi(f, "it's been about a month, so I wanted to check in once more. If you're still curious about the market, I'd be glad to share what's changed."), | |
| 221 | }, | |
| 145 | 222 | }; |
| 146 | 223 | |
| 147 | 224 | /** |
| @@ -159,7 +236,8 @@ export function draft(lead: Asker, day: number, agent: Agent): string { | ||
| 159 | 236 | return `Hi ${first}, it's ${firstName(agent.name)} with ${agent.brokerage}. ${OPENER[lead.source]}! ${ask(topic, address, true)}`; |
| 160 | 237 | return `Hi ${first},\n\n${OPENER[lead.source]}. ${ask(topic, address, false)}\n\nTalk soon,`; |
| 161 | 238 | } |
| 162 | const touch = (TOUCH[day] ?? TOUCH[30]!)(first, topic); | |
| 239 | const words = TOUCH[day] ?? TOUCH[30]!; | |
| 240 | const touch = words[topic](first, addressIn(lead.message)); | |
| 163 | 241 | return channel === "text" ? touch : `${touch}\n\nBest,`; |
| 164 | 242 | } |
| 165 | 243 |
new above
offline