Need a good design for email dispatching for a social network. Basically we want to dispatch emails when the following actions occur
1) New contact request
2) New approval received (An approval is basically a testimonial on a user profile by a contact)
3) Received a new message
4) Notification that an applicant has applied for a job
Note this list will grow so we need a design to which it is easy to add new alerts to and is efficient. I am thinking maybe we can have page which lists all the email alerts where you can create/edit/delete alerts. The create/edit page for an email alert will contain a textarea containing html with placeholders, I dont want to hard code it, but at the same time the messages need to be personalized for example "Hi Gary, AJz has requested to be contacts with you". THe only design problem I see is how to specify what action the email alert is for...
We have a table called contacts which contains unapproved/approved contact requests. The approvals, messages, and job_user table are present.