Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Batch Email Notifications #1019

Open
2 of 8 tasks
Tracked by #1005 ...
ShanaLMoore opened this issue Apr 26, 2024 · 14 comments
Open
2 of 8 tasks
Tracked by #1005 ...

Implement Batch Email Notifications #1019

ShanaLMoore opened this issue Apr 26, 2024 · 14 comments

Comments

@ShanaLMoore
Copy link
Contributor

ShanaLMoore commented Apr 26, 2024

Summary

SOW

The goal is to implement batch email notifications for some activities/trigers in the Hyku application. The notifications should match those of the One-step mediated deposit workflow. That includes:

  • Notifications to submitter and approver for activity related to mediated deposit, which currently produce notifications within the app but not pushed out to email. These including:
    • Work submitted awaiting review
    • Work reviewed and accepted
    • Work reviewed and sent back with comment
    • Work revised and resubmitted for review

Acceptance Criteria

  • Email notifications to submitter and approver for activity related to mediated deposit are set up and include: (see below)
    • Work submitted awaiting review
    • Work reviewed and accepted
    • Work reviewed and sent back with comment
    • Work revised and resubmitted for review
  • Email notifications to authors related to views and downloads of their works are set up

TASKS

Testing Instructions

  1. Be sure the tenant has a contact email set on the account settings, and one-step mediated deposit set for the admin set. (This requires approval for every work created, for example, which also triggers the notifications).
  2. Go to User profile to set the batch email notification frequency.
  3. Create a work. Notice the notification bell should have an additional alert. This alert should be what gets emailed to the user email, per the selected frequency.

Image

Image

Image

Image

Notes

Spike results: #1005 (comment)
Implementation brainstorm: #1005 (comment)

@kirkkwang
Copy link
Contributor

samvera/hyrax#5212 may be of interest

@jillpe jillpe moved this from In Development to Code Review in palni-palci May 3, 2024
@jillpe jillpe mentioned this issue May 6, 2024
2 tasks
@ShanaLMoore
Copy link
Contributor Author

ShanaLMoore commented May 13, 2024

QA RESULTS: Needs Rework

We will come back to check if an email got sent tomorrow. We triggered the notifications today and set the frequency to daily.

Image

re: PENDING

We can see the BatchEmailNotificationJob waiting to be run in /jobs

Image

: :

@ShanaLMoore
Copy link
Contributor Author

ShanaLMoore commented May 15, 2024

After 24 hrs, I did not receive any emails as expected:

Image

Image

@ShanaLMoore ShanaLMoore moved this from Code Review to Ready for Development in palni-palci May 15, 2024
@ShanaLMoore
Copy link
Contributor Author

Perhaps hyku-demo wasn't set up right. Emails are received when tested using on hyku-staging:

Image

@ShanaLMoore
Copy link
Contributor Author

ShanaLMoore commented May 28, 2024

QA RESULTS: PASS ✅

Tested on: PALS KNAPSACK STAGING
Frequency: Daily

I will check maildev in 24 hrs.

UPDATE: The email appeared:

Image

@ShanaLMoore ShanaLMoore moved this from Ready for Development to PALs QA in palni-palci May 29, 2024
@ShanaLMoore
Copy link
Contributor Author

cc @ndroark our staging mailer caught your batch email request:

Image

@ShanaLMoore ShanaLMoore moved this from PALs QA to SoftServ QA in palni-palci Aug 27, 2024
@ShanaLMoore ShanaLMoore moved this from SoftServ QA to PALs QA in palni-palci Aug 30, 2024
@jillpe jillpe moved this from PALs QA to Pitt QA in palni-palci Sep 4, 2024
@ctgraham
Copy link
Collaborator

ctgraham commented Sep 11, 2024

It looks like all mail for demo.palni-palci-staging.notch8.cloud is sandboxed to the "staging mailer" you describe above.

How do I get credentials for a new user in the tenant? When I create and activate a new user, I don't see a way for the user to reset their password, nor for an admin to set their password.

How do I have a user review the email notifications once created?

@ShanaLMoore
Copy link
Contributor Author

ShanaLMoore commented Sep 11, 2024

@ctgraham

You would need assistance with all the above requests because of the mailer interception.

As a workaround, when you create a user an admin user can "activate" the user and it'll set the password to password.

Otherwise you can let us know what tenant/emails you are expecting and we can check it for you and screenshot the email for your review or approval.

@ShanaLMoore
Copy link
Contributor Author

ShanaLMoore commented Sep 11, 2024

@ctgraham I just checked the mail server and see 2 emails. click on the links to set passwords:

Hello [email protected]

Someone has invited you to https://demo.palni-palci-staging.notch8.cloud/, you can accept it through the link below.

Accept invitation

If you don't want to accept the invitation, please ignore this email. Your account won't be created until you access the link above and set your password.


Hello [email protected]

Someone has invited you to https://demo.palni-palci-staging.notch8.cloud/, you can accept it through the link below.

Accept invitation

If you don't want to accept the invitation, please ignore this email. Your account won't be created until you access the link above and set your password.

@ctgraham
Copy link
Collaborator

The following actions were taken in the demo.palni-palci-staging instance this week:

  • ctgraham set to daily email frequency
  • ctgraham+depositor deposited to Default Admin Set
  • ctgraham+depositor deposited to Pitt Notifications Testing
  • ctgraham read in-app notification for Pitt Notifications Testing
  • ctgraham+depositor set for weekly notifications
  • jeffw, abrenner added as watchers with daily email frequency, no messages expected.
  • jfudrow deposited 3 works (with multiple related works automatically created)
  • asw76 deposited 13 works
  • ctgraham read in-app notifications

@ShanaLMoore
Copy link
Contributor Author

ShanaLMoore commented Sep 16, 2024

I checked maildev (our staging mailbox) to see that no emails were sent because the BatchEmailNotificationJob failed. Migrations needed to be run on staging. I ran the migrations and we should hopefully see notification emails going forward.

I'm afraid you may need to redo the actions above ^^ @ctgraham for the users set to "daily" frequency as your actions were done more than a day ago, at the time of fixing staging. anything done more than a day ago won't match the query of emails to send.

To re test I created a new work and manually ran the job. the following emailed was received:

Image

https://demo.palni-palci-staging.notch8.cloud/notifications?locale=en

Image

Switched users and created a work.

email received after manually running job:

Imageat

@ctgraham
Copy link
Collaborator

ctgraham and jfudrow performed multiple editorial actions today, accepting/commenting/returning about a score of submissions.

@ShanaLMoore
Copy link
Contributor Author

@ctgraham The following emails were received this morning:

Image

Image

Image

Image

Image

@ctgraham
Copy link
Collaborator

For John Fudrow, we see two items in his Notifications Feed from two days ago, but only one item in the email. The two items are as follows.
image

What caused this discrepancy?

@ShanaLMoore ShanaLMoore moved this from Pitt QA to Ready for Development in palni-palci Sep 26, 2024
@jillpe jillpe assigned laritakr and unassigned ShanaLMoore Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready for Development
Development

No branches or pull requests

4 participants