psu-libraries / researcher-metadata

Penn State University's faculty and research metadata repository
https://metadata.libraries.psu.edu/
MIT License
7 stars 0 forks source link

Reorder priority of users to receive OA reminder emails #943

Open anaelizabethenriquez opened 9 months ago

anaelizabethenriquez commented 9 months ago

Currently, OA reminder emails go out to the first X users in the list of users that need emails, where X is the "email cap" number in the OA notification settings. A user "needs" an email if they have publication that is subject to the Standard OA Workflow and doesn't have an OA URL, and if they haven't received an email within the last 6 months.

The list of users needing emails seems to be prioritized alphabetically by Access ID. For example, on Feb. 12, 2024, 300 users received reminder emails:

The result of this is that users with Access IDs at the beginning of the alphabet will receive an email in the first week that they are eligible, whereas a user at the end of the alphabet will only receive an email if X is greater than the number of eligible users in a given week.

Ideally, we would order the list of users needing OA reminder emails based on the "OA notification last sent at" time stamp (so that those who received an email furthest in the past get a new email first) rather than alphabetically by Access ID.

This is low priority. I'm hopeful that we'll get through the backlog of users needing OA reminder emails and be able to keep up with this such that the number of users needing an email in a given week is never much greater than X and naturally smooths out. Documenting this issue just in case that doesn't happen.

anaelizabethenriquez commented 8 months ago

Not sure why, but looking at March 25, 2024 emails, this seems no longer to be the case.

anaelizabethenriquez commented 1 month ago

@ajkiessl Related to this issue, I have found a user (bsw13) who has never received a reminder email, and I can't figure out why they haven't (especially since we've gotten the total number of emails needed down to 0 many times). Is there a way to check if they are due for an email? I know how to see the count of users who are due for an email in a given organization, but I'm wondering if there's a list somewhere of the users who are currently queued up for one. Thanks!

ajkiessl commented 1 month ago

@anaelizabethenriquez There isn't a view for admins to see who is queued up for an email, but I can check from the backend. This user is not listed to receive an email. It appears there's an issue with our database query to determine who needs an email. If the user is not part of an organization, they get filtered out. This is the case for this user — no organization. Adding this user to an organization should fix the problem in the short term, but we may want to open an issue to fix the database query. That's assuming we want oa notification emails going out to users not associated with an organization.

Also, we'll probably want to figure out why this user is not associated with an organization.

anaelizabethenriquez commented 4 weeks ago

Thanks, @ajkiessl! I created a new issue for this, #1015.

EricDurante commented 3 weeks ago

Adding this user to an organization should fix the problem in the short term, but we may want to open an issue to fix the database query. That's assuming we want oa notification emails going out to users not associated with an organization.

Also, we'll probably want to figure out why this user is not associated with an organization.

I can't remember for sure why this was a condition in the query, but I'm certain that it was intentional. It may have been an attempt to make sure that RMD doesn't send OA emails to people who are still in the database but no longer affiliated with Penn State (thus, no organizations). Whether or not the data about organization affiliation stays sufficiently up-to-date and whether or not it's correct enough for that to work is another question.

As @ajkiessl said, I suppose we'd want to determine:

  1. Whether or not my guess above is correct
  2. If bsw13 actually belongs in one or more organizations
  3. If so, why they're not in them currently
  4. Whether or not the organization membership data is generally reliable enough to use for this purpose