Ok, what I'm trying to do is build a feature for a real estate website that will allow users to do the following:
- register on the site,
- do a search of properties stored in a channel,
- save the search criteria,
- then receive an email alert when a new property is added that matches their saved search
I've done some research on this and there doesn't seem to be a straightforward way to do this in EE. I've seen MX Notify Control addon but it seems that this would alert on all new entries to a channel to all users.
Below is what I'm thinking of doing. I'm hoping I could get some input from the EE community on what they think of this approach, is it overcomplicating things or maybe there's a suggestion for a better approach.
Here goes:
- Install Solspace Super Search and Email-from-Template addons
- Allow users to register on the site using native EE functionality
- Users can then search the entries in a "Property" channel based on keyword, price, location and/or status.
- Then allow users to save their search using Solspace Super Search and their Save Search Form tag
- I could create a standalone page then that loops through all saved searches using the exp:super_search:history tag, pull out the search criteria, use that criteria to do a search of the property channel and limit the results to ones added in the last 24 hours only.
- If entries are retrieved, create an html email with the property details and send the mail using Email-from-Template addon or possibly through Postmark App or similar.
- Set up a cronjob to run this page every 24 hours at a quiet time of the day, e.g. 4am
So, that's what I'm thinking. I know this page could become quite resource intensive with loops within loops (the more members and saved searches, the longer it will take to process) but I can't think of another way to do this.
Anybody got any suggestions, ideas or pitfalls I should consider?
Or maybe I should write a custom addon to do this?
Thanks,
Dave