This topic is locked

sending update emails to multiple people

2/20/2014 4:50:19 PM
PHPRunner General questions
W
wfcentral author

just looking for ideas on the best way to approach this.
Here is an example scenario of what I'm working with (items changed slightly to make it easier to understand).
I have a table of projects.
I have a table of daily logs that are tied to each project.
I have another table for contacts.
I can assign 1 or more contacts to each project.
When I add a log entry to a project any contact(s) who are assigned to that project should get an email telling them a new entry has been posted.
When I edit a log entry in a project any contact(s) who are assigned to that project should get an email telling them an entry has been edited.
I have looked at the event to send email on add/edit. Obviously I get stumped at pulling in multiple email addresses from a table that is joined to the table being edited (in other words, the email address is not right in that table being edited). Also, I can't do a simple join and bring in the email address because there could be multiple contacts attached to a project.
So, before I hand-code this I thought I would see if there are any ideas that can be suggested.
Thanks in Advance!

Sergey Kornilov admin 2/21/2014

I guess this is the job for AfterAdd/AfterEdit events. Once log entry is added or updated pull a list of contacts from another table and send an email.
Sample code:

http://xlinesoft.com/phprunner/docs/send_email_to_email_addresses_from_user_table.htm