Adding a mailer function to send e-mail notifications to project owners for expiring deploy tokens
- 
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 project owners and maintainers when their deploy tokens are about to expire. This is 2/3 MR and a follow up of Add database columns for 7+30+60d Deploy Token expiry notifications
The 3/3 MR, worker implementation is Add worker for sending emails notifications for expiring deploy tokens (WIP)
Key features:
- Sends email notifications at 7, 30, and 60 days before deploy token expiration
- Targets project owners and maintainers who have permission to manage deploy tokens
- Includes direct links to the project's deploy token settings for easy token renewal
- Tracks notification delivery to prevent duplicate emails
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 project owners for expiring deploy tokens
Edited  by Pratibha Gupta

