@@ -49,6 +49,46 @@ and follow-up. Each is plaintext, under ~120 words, with a single CTA and
4949deliverability notes. See [ ` templates/README.md ` ] ( templates/README.md ) for
5050how to load one into a campaign.
5151
52+ # AI Personalization
53+
54+ Templates give you a starting point. Personalization is what turns a
55+ starting point into a draft worth sending. Coldflow ships an opt-in helper
56+ endpoint that takes a contact and a template and returns a personalized
57+ variant — filling any remaining ` {{vars}} ` and adding 1–2 light touches
58+ that acknowledge the recipient's role and reference their company
59+ specifically.
60+
61+ ** UI:** open ` /dashboard/campaigns/new ` , pick a template, then click
62+ ** Personalize with AI** . Provide a contact (name, company, role) and
63+ review the line-by-line diff before applying.
64+
65+ ** API:** ` POST /api/personalize `
66+
67+ ```
68+ {
69+ "template_id": "sales_founder_direct",
70+ "contact": {
71+ "name": "Alex Chen",
72+ "company": "Acme Robotics",
73+ "role": "VP of Engineering",
74+ "product_name": "Coldflow",
75+ "sender_name": "Jared"
76+ }
77+ }
78+ ```
79+
80+ Any extra string fields on ` contact ` become optional context — variables
81+ like ` {{product_name}} ` are filled deterministically server-side before
82+ the LLM is asked to add personalization touches. The response includes
83+ ` personalized_subject ` , ` personalized_body ` , ` used_variables ` , and the
84+ SDK ` usage ` object so you can track spend. Authenticated callers are
85+ limited to one request every two seconds.
86+
87+ ** Setup:** add ` ANTHROPIC_API_KEY=… ` to your ` .env ` (see ` .env.example ` ).
88+ Without a key the endpoint returns 503 and the UI shows a clean error.
89+ Default model is ` claude-haiku-4-5-20251001 ` ; override with
90+ ` ANTHROPIC_PERSONALIZE_MODEL ` .
91+
5292# Move the needle TO-DO list:
5393
5494- [ ] Integration with GHL / N8N
0 commit comments