-
Notifications
You must be signed in to change notification settings - Fork 64
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
Send invite Reminders #4824
Send invite Reminders #4824
Conversation
part of #4380
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4824 +/- ##
==========================================
+ Coverage 78.67% 78.74% +0.06%
==========================================
Files 314 323 +9
Lines 15125 15221 +96
Branches 3483 3496 +13
==========================================
+ Hits 11900 11986 +86
- Misses 3225 3235 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Need to work out how to write tests for this (need time travel or backdated database entries) Also need to ensure this only runs if email enabled and do we want to make this behind a flag in the admin settings? |
Also check the email content
Looks okay from a first pass through. Want to sanity check the right emails are sent to the right parties - I note the tests just verify the right number of emails are sent, not that the right content was sent to the right recipient. We also need to consider the scaling issue. Is the easy option just to add a 'reminderSent' column to the table? |
We could add a column to the Invitations table, but we'd have to have it run multiple times a day to reduce the chance of restarts meaning that we never sent the reminders. I'll add some more to the tests to check the email contents |
OK, I have a version that uses a db column to record when the invite was sent. I'm running the job with the following cron job
This will run at 15 min intervals, with a random offset between 0 & 15mins. This should mean that different instances run at different times, but that it not skip a day if the app is restarted. It may be a bit too many times, but it should only send reminders once, so should be a null op most of the time. |
This is to allow horizontal scaling
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
Testing locally, I see the emails get sent, but I consistently get this error in the logs:
The Invitation's |
I think this is a complete red herring. The error is the response being returned by my local test SMTP server. From our logs, two mails were sent. Looking at the inbox, only one arrived. |
Yup - upstream issue with my choice of SMTP tools - nodemailer/nodemailer-app#3 |
part of #4380
Description
Sends reminder emails to invitees if not actioned in 2 days.
Also includes a house keeping job to remove expired invites from the database.
Still need to also send email to inviter to say not accepted yet.Also needs tests, but will need to work out how to inject invites into the database with a customcreatedAt
entry in the database.Related Issue(s)
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
area:migration
label