Help with email Notification Help with email Notification
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Help with email Notification

Started by derricky, January 23, 2004, 01:25:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

derricky

I need some help with what I am trying to do.  I would like people to be able to "subscribe" to a album.  Then when new pictures are added to that album they will get an email saying hey someone just upload pictures to that album you subscribed to.

the thought process I have is
1) create subscribe table that contains userid from users table and aid from albums
2) add button in thumbnails.php to subscribe, that fills these two fields in
3) modify dbinput.php with a notification function that will go out and get all the user id'd that subscribe to this album. Pass these id's to an email.php that will generate the message and send.

Does this seem like I am on the right track or have I seriously underestimated the requirements.  One thing I thought of was having dpinput put the user_id in a temp table then email.php would read from the temp table and flush it when finished.  Is this a better approach?

Derrick

Joachim Müller

I wouldn't use this workaround if you plan to contribute your mod to the coppermine community later - some coppermine installations are rather big - having addidtional tables (even if they are temporary) is not a good option imo. Since all you need is a trigger that fires the email when pictures are added to an album, I'd go for inclusion of the "send email" process into the process where the pics are added to the db (and remember there are some who have admin approval - the mail should only be sent out if the pics are visible to everyone - that means the admin has approved; this would have to be another trigger).

GauGau

derricky

ok so if you say I should not add any tables what would be the recomended path to track what albums people are subscribed to.   I do not want every person notified everytime a picture is uploaded

Joachim Müller

add one extra field int cpg_albums and store the user-ids of the people who described to it in a list (with separators). This way, you'll have a linear query load (the more people subscribe to an album, the longer the loop will take to run).

GauGau