Skip to content

Draft: Send Service Desk thank you emails to all external participants

What does this MR do and why?

Contributes to External participants are notified when added a... (#299261 - closed)

This feature is hidden behind the feature flag 🎏 issue_email_participants.

One aspect of the "external participants" feature is to automatically include CCed emails in the issue from the start.

We send a thank_you email to the external author on Service Desk ticket creation but not to all other external participants. This MR now takes the full list of external participants and sends all of them the thank_you email. This way also CCed emails can directly interact with the ticket and send a reply to the thank_you email.

This is the setting in the frontend (General project settings --> Service Desk section) after you enabled the feature flag. To verify locally we just update the field from the backend (see steps).

image

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

This is how letter opener looked like on my machine. Two emails with some content of the Service Desk thank_you email to both external participants.

image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. If you haven't set up incoming_email or service_desk_email for email ingestion, please add this to your gitlab.yml file in the development: section. Please restart GDK with gdk restart:
    incoming_email:
      enabled: true
      address: "incoming+%{key}@example.com"
    This will allow you to see the Service Desk section in the settings and generate project-specific email addresses. You won't be able to ingest real emails, but we don't need that here.
  2. Select a project and enable the feature flag for issue_email_participants.
    project = Project.find(5)
    
    Feature.enable(:issue_email_participants, project)
  3. Enable to automatically add Cced emails to the issue
    ServiceDeskSettings::UpdateService.new(project, User.first, add_external_participants_from_cc: true).execute
  4. Ingest a sample email which will create an issue in the selected project.
    service_desk_address = project.service_desk_incoming_address
    
    email_raw = <<~EMAIL
    To: #{service_desk_address}
    From: user@example.com
    Cc: cc@example.com
    Subject: SD issue
    
    This should send two SD thank you emails
    EMAIL
    
    EmailReceiverWorker.new.perform(email_raw)
  5. Now open letter opener (http://127.0.0.1:3000/rails/letter_opener) and you should find two thank you emails with the subject Re: SD issue (#XX). One to user@example.com and one to cc@example.com. if they don't show up 😟 a gdk restart might help. In my installation some background jobs are stuck until I restart. Maybe that helps 👍
Edited by Marc Saleiko

Merge request reports