Paste mortgage rates into chat and send a rate update — publishes a rate page to the website and sends teaser emails via Mailchimp.
You are sending a weekly rate update for Adam Styer's mortgage website. The user pastes rates into chat and you run the full pipeline: normalize rates, preview AI-generated content, confirm, then publish and send emails.
Normalize whatever format the user pastes into:
Product Name: Rate | APR: AprValue
Example:
30-Year Fixed: 6.875% | APR: 6.95%
15-Year Fixed: 6.25% | APR: 6.35%
FHA 30-Year: 6.5% | APR: 7.15%
VA 30-Year: 6.25% | APR: 6.45%
If APR is not provided, omit the | APR: portion.
down, up, flat, volatile — infer from user's message["borrower", "realtor"] — narrow if user says "just borrowers" or "realtors only"Show the user:
Here's what I'll send:
Rates:
[formatted rates]
Direction: [value or "not specified"]
Audiences: [Borrower, Realtor]
Talking points: [blurb or "none"]
Notes: [notes or "none"]
Running preview first — ready?
Wait for confirmation.
Use bash tool:
curl -s -X POST https://styermortgage.com/.netlify/functions/generate-rate-update \
-H "Content-Type: application/json" \
-d '{
"rates": "<rates string>",
"direction": "<direction>",
"blurb": "<blurb>",
"notes": "<notes>",
"audiences": ["borrower", "realtor"],
"mode": "preview"
}'
From JSON response, display:
preview.pageTitle — page titlepreview.webContent — summarize HTML as readable textpreview.borrowerSubject — borrower email subject linepreview.realtorSubject — realtor email subject linepageUrl — where it will publishAsk: "Ready to go live? This publishes the rate page and sends emails."
Same payload, "mode": "live":
curl -s -X POST https://styermortgage.com/.netlify/functions/generate-rate-update \
-H "Content-Type: application/json" \
-d '{
"rates": "<same rates>",
"direction": "<same direction>",
"blurb": "<same blurb>",
"notes": "<same notes>",
"audiences": ["borrower", "realtor"],
"mode": "live"
}'
Report:
pageUrlcampaigns array — audience + statusAfter a successful live publish, log the rate update to the LoanOS History tab so cadence badges stay current.
Read the secret from .env.local:
AGENT_SECRET=$(grep LOANOS_AGENT_SECRET /Users/adamstyer/Documents/loanos-clone/.env.local | cut -d'"' -f2)
Then log:
curl -s -X POST https://loanos-self.vercel.app/api/marketing/log \
-H "Content-Type: application/json" \
-H "X-Webhook-Secret: $AGENT_SECRET" \
-d '{
"activity": "Rate update sent — <date>",
"channel": "Rate Update",
"notes": "<first 120 chars of rates string>",
"tracker": "rate-update"
}'
Replace <date> with today's formatted date (e.g. "Apr 3, 2026") and <notes> with a summary of the rates sent. The tracker field updates the cadence badge on the History tab.
If the curl fails, report the error but don't block — the rate update itself already went out.
https://styermortgage.com/rates/YYYY-MM-DD.html