There's a "Jobs" section on my website (custom post type), with various associated taxonomies (language spoken, type of contract, location, etc.) The website also has a very big user base (about 10 000 subscribers). These users have access to a form where they chose "jobs" criterias they are interested in, in order to receive a daily email with the list of "jobs" that correspond to their criterias.
I'd like to have your opinion on the best way to implement that functionality.
My first approach is this :
- Loop through all the "subscriber" users
- For each user, get the criterias they have chosen (language, type of contract, city, etc.)
- with these criterias, make a WP_Query on all the "jobs" published that day
- send the results by email
This function would be triggered daily thanks to wp cron.
My worry is that this is perhaps a very ressource intensive way (that's a loop executing 10 000 different wp_queries in a row!) The website is hosted on a dedicated webserver (quad core with about 8Gigs of ram)
Is there a more efficient way ?