Skip to content

Don't send Service Desk emails when service_desk_enabled? is disabled

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

🚫 backend only change

How to set up and validate locally

Service Desk is enabled by default for every project.

  1. 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)
  2. You should see the issue in the Service Desk issue list: http://127.0.0.1:3000/jashkenas/Underscore/-/issues/service_desk
  3. Browse to the issue detail page and write a comment.
  4. You should see the service desk email in letter opener
  5. Browse to the settings page and expand the Service Desk section and disable Service Desk: http://127.0.0.1:3000/jashkenas/Underscore/edit
  6. Go back to the issue (maybe reload) and write another comment.
  7. 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.

Edited by Marc Saleiko

Merge request reports