Draft: feat: Send email notifications for expiring deploy tokens to group owners
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do and why?
This MR implements a mailer function which would send email notifications to group owners when their deploy tokens are about to expire. This is an extension of Adding a mailer function to send e-mail notifications to project owners for expiring deploy tokens
The worker implementation is Add worker for sending emails notifications for expiring deploy tokens (under review)
Key features:
- Sends email notifications at 7, 30, and 60 days before group deploy token expiration
- Targets group owners who have permission to manage deploy tokens
Screenshots [Preview of the notification email]
Email templates created:
- HTML version:
app/views/notify/deploy_token_about_to_expire_email.html.haml
- Text version:
app/views/notify/deploy_token_about_to_expire_email.text.erb
How to set up and validate locally
- Launch the rails console:
bundle exec rails c
- Create a dummy user, dummy project and a deploy token with expiration of less than 7, 30, 60 days.
- Start the rails server:
bundle exec rails s
- Head over to
http://localhost:3000/rails/mailers/notify/deploy_token_about_to_expire_email
- This should now render the email on the screen, with the help of preview.
References
Relates to Send an e-mail notification to group owners for expiring deploy tokens
Edited by Pratibha Gupta