Show why a notification email was sent
We currently add some custom headers to emails:
-
X-GitLab-Project(-(Id|Path))?
- the name, ID, and path of the containing project for the email topic. -
X-GitLab-Discussion-ID
- the ID of the discussion (thread) this comment is from, in comment emails. X-GitLab-(Issue|MergeRequest|...)-ID
-
X-GitLab-Reply-Key
- a unique token to support reply by email.
One thing that we don't add, but would be really nice, is why you got the email. For instance, I would like to filter out emails on issues and MRs that mention me, because those will create todos.
We already support custom notification levels, which means that in the relevant services (the NotificationService
and NotificationRecipientService
), we already know something about why this is being sent - although it might not match up exactly.
I think it would be nice if we had at least:
- Mention.
- Assignment.
- Your own activity.
Things that might be trickier:
- Label subscription.
- Watching the project, although not a participant in the topic of the email.
- Participant.
- Subscriber.
Probably for a future iteration would be to do what GitHub does, and have these as CC recipients. To do that, we'd probably need https://gitlab.com/gitlab-org/gitlab-ce/issues/37403 to do this, as we don't currently do a good job of having a clear structure to 'our' namespace in the reply by email feature, and we'd want those CC addresses to go to GitLab.