uploadnotify plugin uploadnotify plugin
 

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

uploadnotify plugin

Started by 406man, August 11, 2023, 04:50:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

406man

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):

  • Album name
  • Category
  • Title
  • Caption
  • 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.

-----------------
During testing of a potential new plugin I found a coding bug in this plugin. The bug only showed itself if another installed plugin used the 'add_file_data_success' plugin hook (for example, my autoapprove plugin) and uploadnotify was higher in the plugin list so that it ran first. I've re-released uploadnotify as version v1.01 and deleted the first version.   Apologies to those who have been inconvenienced.