Loris icon indicating copy to clipboard operation
Loris copied to clipboard

[Media] Upload Digest Notifications (Override from CCNA)

Open skarya22 opened this issue 2 years ago • 1 comments

Brief summary of changes

  • Introduction of a php script that can send users that opt-in a digest of the recently uploaded files to the media module for projects that they have permission to.
  • Implements project separation ability in the notification system
  • The script can be run with php media_upload_digest.php [-days|-months|-years] [number] [-email (optional)] in the tools directory

CCNA Overrides Involved:

  • https://github.com/aces/CCNA/pull/6302
  • https://github.com/aces/CCNA/pull/6407

Testing instructions

  1. run mysql -A < SQL/New_patches/2023_07_19_Add_Media_Digest.sql
  2. Login as a user and open my preferences > notifications and confirm that 'Media: Email Digest of Recently Uploaded Files' has N/A beside it
  3. Login as admin and add the permission 'media_upload_digest' / 'Media files: Access to recently uploaded media notifications digest.' to the user
  4. Log back in as the user and go to the notifications tab, confirm the N/A is replaced with an empty tick box and add the 'Media: Email Digest of Recently Uploaded Files' notification
  5. Try to run the script and confirm the email arrives to your address or run lines 64 to 75 of media_upload_digest.php in your mysql to see which users it selects (should be just your user)
  6. Upload a media file in a project that you are assigned to and make sure that you get a notification
  7. Upload a media file in a project that you are not assigned to and make sure that you do not get a notification
  8. Set your user to have multiple projects
  9. Upload a media file in multiple projects and make sure that you get a notification for both

Example of email

image

skarya22 avatar Jul 20 '23 15:07 skarya22

Is there user documentation somewhere on how to set this up? RTD? Module README? It looks like it needs a cron job.

driusan avatar Dec 12 '23 17:12 driusan