Menu · Build with AI
Build with AI

Prompt: Listing Alerts

Listing Alerts on your site: an "Email me new matches" form, the manage-alerts and unsubscribe pages, and the webhook route that sends each alert through your email provider.

View as Markdownopenapi.json

This prompt builds Listing Alerts on your site with your secret key and your own email provider.

The prompt

Prompt
Read RUUSTER_IDX.md first and follow its MUST and NEVER rules. Ask me if it doesn't cover something.

Add Listing Alerts to my site, following <https://help.ruuster.com/idx/alerts-quickstart>, <https://help.ruuster.com/idx/recipe-save-search> and <https://help.ruuster.com/idx/recipe-manage-alerts>. Put an "Email me new matches" form (AlertSignupForm) on my search page that posts to a server route, /api/alerts/save-search, which calls idx.alerts.buyers.create with my secret key and the consent words the visitor saw. Add my manage-alerts page at /alerts/manage and my unsubscribe page at /alerts/unsubscribe, and set their addresses with idx.alerts.settings.update. My consent sentence is: [your consent sentence]. My postal address is: [your postal address].

Add a webhook route at /api/alerts-webhook that verifies the signature with verifyWebhook, sends each delivery.ready alert through [your email provider] from [your sending address], copies the delivery's headers onto the email, and reports the result. Use these environment variables: IDX_SECRET_KEY, RUUSTER_ALERTS_WEBHOOK_SECRET and my email provider's key, all server only. Never paste a secret key into a chat.

When you are done, tell me how to test it: save a search with my own email, wait for the welcome alert, and use each link in it.

What it builds

  • the AlertSignupForm on your search page and the /api/alerts/save-search route behind it
  • the manage-alerts and unsubscribe pages every alert links to
  • the alerts webhook route that sends each alert and reports the result

How to check it

  1. Save a search with your own email. The welcome alert arrives within a few minutes when homes match.
  2. Use the email's unsubscribe link and the manage link, and check that each change shows on the manage page.

Before you paste it

Follow the setup on Build it with your AI coding assistant once: RUUSTER_IDX.md at the root of your project, the two lines in CLAUDE.md or AGENTS.md, and your keys in .env.local. Never paste a secret key into a chat. Replace the text in square brackets with your own before you send the prompt.