Triggering email notifications if total values in a table within a date range reaches a threshold

Options
Hello, I wonder if someone can help.

I'd like to be able to trigger email notifications to users in a location (e.g. a specific county) if rows submitted to a database that mention their county surpass a threshold.

So imagine someone has signed up to a service where they want alerts of new property sales in an area where the county value is stored and we want to notify users when there's more than 5 listings in that county.

Which set of features and functions in Xano would enable me to set the rule that IF records in the database mentioning a specific county >5 THEN send user records with that county in the database an email notification listing the 5 new properties ELSE do nothing.

Any help would be much appreciated, thanks 😊

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
    I'd imagine doing this as a background task. Every x hours or minutes fire off a query that looks at the count of listings by county. If the count is >5, send the emails. Then record the last time you sent the notification to the users so that you don't just re-send the notification because the count will still be >5 when you run the check again in a few minutes.