4Science / DSpace

This repository contains the 4Science optimized DSpace & DSpace-CRIS distribution.
https://wiki.lyrasis.org/display/DSPACECRIS/
BSD 3-Clause "New" or "Revised" License
42 stars 61 forks source link

Subscriptions of Items are sending mails to non-subscribers #380

Closed olli-gold closed 10 months ago

olli-gold commented 1 year ago

Describe the bug The subscription script (bin/dspace subscription-send) is sending emails with wrong content to persons. After a person has gotten an email with the contents subscribed by them, the next person will get the same content (additional to the content they have really subscribed to). The problem only affects subscriptions of items (for instance persons) to get notifications, when the person was added to a publication.

To Reproduce Steps to reproduce the behavior:

  1. Be sure, that you have at least one person with a valid item subscription on your system and many more, who do not have a subscription
  2. Be sure to have at least one publication, which was added or changed according to the existing subscription
  3. Be sure not to send unwanted emails (for example by changing the email settings mail.server.disabled = true and mail.server.fixedRecipient in local.cfg)
  4. Start the script bin/dspace subscription-send
  5. Wait, until you get an email for the existing subscription
  6. See, that after that others will follow (unless this person was the last person to be performed incidentally)

Expected behavior The persons should only get emails about their subscribed content.

Related work https://github.com/4Science/DSpace/commit/2e7ff80c140373a62304a828b3d7aa16102b1af0