Skip to content

Draft: feat: Send email notifications for expiring deploy tokens to group owners

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]

HTML email image

Plain-text email image

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

  1. Launch the rails console: bundle exec rails c
  2. Create a dummy user, dummy project and a deploy token with expiration of less than 7, 30, 60 days.
  3. Start the rails server: bundle exec rails s
  4. Head over to http://localhost:3000/rails/mailers/notify/deploy_token_about_to_expire_email
  5. 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

Merge request reports

Loading