Add system note when external participant unsubscribes
What does this MR do and why?
Contributes to #299261 (closed)
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 |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
If you haven't set up
incoming_email
orservice_desk_email
for email ingestion, please add this to yourgitlab.yml
file in thedevelopment:
section. Please restart GDK withgdk 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.
-
Select a project and enable the feature flag for
issue_email_participants
.project = Project.find(7) Feature.enable(:issue_email_participants, project)
-
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. -
Now add a public comment. The content doesn't matter (we just want the notification email).
-
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 touser@example.com
. If they don't show up😟 agdk restart
might help. In my installation some background jobs are stuck until I restart. Maybe that helps👍 -
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. -
Reload the issue in the other window and find the new system note saying
GitLab Support Bot unsubscribed user@example.com
.