Don't send Service Desk emails when service_desk_enabled? is disabled
requested to merge ms-disable-emails-for-external-participants-when-service-desk-is-disabled into master
What does this MR do and why?
Contributes to Service Desk issue moved to project with Servic... (#422303)
This MR ensures that we don't send Service Desk emails when Service Desk is disabled.
Screenshots or screen recordings
How to set up and validate locally
Service Desk is enabled by default for every project.
- Make an issue a Service Desk issue. Run this in the rails console:
project = Project.find(6) issue = project.issues.last email = 'user@example.com' issue.update!(author: User.support_bot, service_desk_reply_to: email) IssueEmailParticipant.create!(issue: issue, email: email)
- You should see the issue in the Service Desk issue list: http://127.0.0.1:3000/jashkenas/Underscore/-/issues/service_desk
- Browse to the issue detail page and write a comment.
- You should see the service desk email in letter opener
- Browse to the settings page and expand the Service Desk section and disable Service Desk: http://127.0.0.1:3000/jashkenas/Underscore/edit
- Go back to the issue (maybe reload) and write another comment.
- You should see no new service desk email in letter opener
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Marc Saleiko