Plugin: uploadnotify

Author:  KF  (406man)
Description: Sends a configurable email when a file is uploaded
License: Standard Coppermine
Installation: Standard method.
Version: V1.01   This is the first released version with a minor bug fix

This plugin will send an email when a file is uploaded into an album. The contents of the email are configurable. A 
Coppermine standard feature allows sending an email to the administrators when a file that needs approval is uploaded but 
the contents and recipients of the email can’t be changed and it only applies to files that need approval.

Years ago I implemented a notification email feature in my galleries by editing the Coppermine source code but this isn’t 
good practice and became a nuisance when a Coppermine upgrade was released as the code needs to be reviewed and updated. To 
make my galleries maintainable in the long run I’ve developed this plugin which I’m sharing with the user community. 

The following items can be configured:
•	Recipients (up to 5), 
•	Subject 
•	Message content 
•	The following items can be included in the message (or not):
    o	  Album name
    o	  Category
    o	  Title
    o	  Caption 
    o	  Link to the displayed image (in displayimage.php). 
A button allows a test email to be sent and check the contents of the email.

During configuration the plugin reports whether the standard Coppermine upload notification is enabled or not and allows 
the admin to change the setting here rather than force them to go to the Config section. If both are enabled an 
administrator might receive two emails. This might be desired behaviour or it might not. The administrator has a choice.

LIMITATIONS: 
1) The CoreH5A upload method allows one or more images to be uploaded in a group and the program then moves to “editpics” 
to allow image information to be added. This plugin is triggered when the images are uploaded and before the image 
information is added. Therefore the email will be sent with blank Title and Caption fields if these fields are included in 
the email. The ways around this are:
i) disable the h5upload plugin leaving just the CoreSGL upload method but this may inconvenience gallery users.
ii) or: configure the email so it doesn’t include the Title and Caption fields
2) When multiple files are uploaded at once using the CoreH5A method, one email per uploaded file will be sent. Recipients 
might get annoyed by receiving multiple emails but this is a feature of the implementation of the plugin hook in the 
Coppermine core rather than a fault in the plugin
3) If your gallery requires uploaded images to be approved by an admin, the optional link in the email will only work after 
the image has been approved. If clicked on before that point it will give an error message. 

