Skip to content

Add system note when external participant unsubscribes

What does this MR do and why?

Contributes to #299261 (closed)

The code is hidden behind the feature flag 🎏 issue_email_participants but it is enabled on gitlab.com and scheduled to be enabled by default in 17.0.

External participants don't have a GitLab account and can participate in the discussion via email only. They can be invited and be removed and can unsubscribe from the issue.

Now a system note states that an external participant was unsubscribed so users on the issue know that they are no longer part of the conversation.

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
None 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 emails, but we don't need that here.

  2. Select a project and enable the feature flag for issue_email_participants.

    project = Project.find(7)
    
    Feature.enable(:issue_email_participants, project)
  3. Create a regular issue and make this a Service Desk ticket using the /convert_to_ticket user@example.com quick action in a comment. Reload the page for a full data refresh.

  4. Now add a public comment. The content doesn't matter (we just want the notification email).

  5. Ensure that the Service Desk notification email has been sent to the external participant. Open letter opener (http://127.0.0.1:3000/rails/letter_opener) and find the Service Desk email to user@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 👍

  6. This email should contain an unsubscribe link. It should look somewhat like this http://127.0.0.1:3000/-/sent_notifications/[HASH]/unsubscribe. Copy the link and paste it into a new private browser window. You should be able to unsubscribe and see a success message.

  7. Reload the issue in the other window and find the new system note saying GitLab Support Bot unsubscribed user@example.com.

Edited by Marc Saleiko

Merge request reports