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

Add account renewal email #23

Merged
merged 3 commits into from
Dec 31, 2024
Merged

Add account renewal email #23

merged 3 commits into from
Dec 31, 2024

Conversation

ben-z
Copy link
Member

@ben-z ben-z commented Dec 30, 2024

This PR adds an account renewal email:

image

@ben-z ben-z requested a review from Copilot December 30, 2024 21:21

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

emails/account-renewal.tsx:35

  • [nitpick] The preview text could be more personalized by including the user's name. Suggestion: Reminder: ${name}, your WATcloud access expires on ${expiresOn} (in ${daysUntilExpiry} days).
const previewText = `Reminder: WATcloud access expires on ${expiresOn} (in ${daysUntilExpiry} days)`;

emails/account-renewal.tsx:55

  • The sentence should be 'If you have received this email in error, please contact us at [email protected].'
If you have received this email in error, please contact us at <Link href="mailto:[email protected]">[email protected]</Link>.
@ben-z ben-z merged commit 7738197 into main Dec 31, 2024
1 check passed
@ben-z ben-z deleted the benz/account-renewal branch December 31, 2024 05:42
wato-github-automation bot pushed a commit to WATonomous/watcloud-website that referenced this pull request Dec 31, 2024
## Description

This PR introduces the concept of "Active Terms". Each user will specify
a list of terms that they are active, and near the end of their last
term, we email them about renewal.
<img width="871" alt="image"
src="https://github.com/user-attachments/assets/93697173-bff9-4f65-a74a-4a64d25ea8a9"
/>

This PR contains a hard-coded safeguard to only send emails to me. After
more testing, we will remove this safe-guard.

## Checklist
- [x] I have read and understood the [WATcloud
Guidelines](https://cloud.watonomous.ca/docs/community-docs/watcloud/guidelines)
- [x] I have performed a self-review of my code
- [ ] POST-MERGE: Automation to add new term options - perhaps do this
2.5 terms in advance.
- [x] Email notifications about renewal (30 days, 7 days) - include a
check to make sure a newer term is available.
- [x] Email template:
WATonomous/watcloud-emails#23
- [x] The ability to send to multiple email addresses at the same time
(if a user specified multiple emails in their profile)
WATonomous/terraform-provider-email#11
- [x] Automation to expire users and generate a description of the
changes
- [x] Add the ability for users to delete their accounts right away.
Perhaps link a prefilled onboarding form with the result of expiring the
user.
- [x] Add notes in the additional comments section (or add a “system
comments” section) about how these renewal/delete requests are auto
generated. This is for debugging.
- [ ] POST-MERGE: Send out a notification email to users before merging
this, so that they have a heads up. Perhaps combine this with the
announcement for #3370 .
- [ ] POST-MERGE: Add an active term to all users (except the ones who
don't expire).
- [ ] POST-MERGE: Test the end-to-end pipeline.

## Notes

Expiry spec testing:

```py
from directory.scripts import user_utils
users = user_utils.get_all_users()
raw_users = user_utils.get_all_users_raw()
user = next(u for u in users if u['general']['watcloud_username'] =='ben')
raw_user = next(u for u in raw_users if u['general']['watcloud_username'] =='ben')
ret_has_changes, ret_user, ret_details = user_utils.generate_expiry_specs(user, raw_user, True)
print(ret_details)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant