0

I need some ideas in regards to the database management of the email alerts that my website is sending out.

www.gubbit.com

My website sends out deal alerts of the products on deals everyday. Typically a product deal stays ON for 3-4 days and my script is sending the same deal everyday through emails until it expires. I want to create a log mechanism such that when I send alert emails, it automatically logs what deals have been already sent to the specific user so that next day it wont send the same ones. Currently all my deals are stored in a MySQL database and the alerts are send through a search query. Typically each email would have a list of deals that matches the keyword provided by the user.

Please help out.. Thanks in advance!

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by diafol
0

Unless we know how you're storing the data and sending the emails, it's difficult to comment.

You could have a link table:

deal_id
user_id

For a deal, search for users that have specified the keyword but are NOT in the link table matching user_id and deal_id
The user_id/deal_id pair is only inserted on successful email
You can remove pairs when the deal expires (e.g. via cron job) in order to avoid growing your table to a ridiculous size.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.