Hi,
I'd like to create a mail alert, notification script which sends email to members in the mysql db if there is a new ad posted in the db, further narrowed down by the criterias each member set. Similar to what this forum has.
I have an "ads" table and the an "alert" table.
In the ads table members post their ads with usual fields like:
ad_id, member_id, category, subject, description, city, biztype, etc...
In the alert table others can post their search criterias and their email address that will be saved.
fields: alert_id, member_id, category, city, biztype, email
Now when I run the script I want it to "scan through" the two tables compare them and send email only to those members that have criterias matching those fields in the "ads" table.
Important thing that I'd like to have it send only one email per member. In the body of the email there would be the "search result", the list of matching ads for that member like this:
Subject of ad 1
Link for ad 1
Subject of ad 2
Link for ad 2
Subject of ad 3
Link for ad 3
.
.
.
etc.
I want to run the script daily, so it would select the ads that were posted in the last 24 hours.
Could anyone help me in this? I've tried a lot of things but then I realized I'm not able to do it 🙂) I'd appriciate any help.
Thank you