notifications.md 7.8 KB
Newer Older
K
karen Carias 已提交
1
# GitLab Notification Emails
M
Marin Jankovski 已提交
2

K
karen Carias 已提交
3
GitLab has a notification system in place to notify a user of events that are important for the workflow.
M
Marin Jankovski 已提交
4 5 6

## Notification settings

7
You can find notification settings under the user profile.
M
Marin Jankovski 已提交
8

9
![notification settings](img/notification_global_settings.png)
M
Marin Jankovski 已提交
10

11
Notification settings are divided into three groups:
M
Marin Jankovski 已提交
12 13 14 15 16 17 18 19 20 21 22

* Global Settings
* Group Settings
* Project Settings

Each of these settings have levels of notification:

* Disabled - turns off notifications
* Participating - receive notifications from related resources
* Watch - receive notifications from projects or groups user is a member of
* Global - notifications as set at the global settings
F
Felipe Artur 已提交
23
* Custom - user will receive notifications when mentioned, is participant and custom selected events.
M
Marin Jankovski 已提交
24 25 26 27

#### Global Settings

Global Settings are at the bottom of the hierarchy.
28
Any setting set here will be overridden by a setting at the group or a project level.
29 30

Group or Project settings can use `global` notification setting which will then use
M
Marin Jankovski 已提交
31 32 33 34
anything that is set at Global Settings.

#### Group Settings

35 36
![notification settings](img/notification_group_settings.png)

37 38 39 40 41 42
Group Settings are taking precedence over Global Settings but are on a level below Project or Subgroup Settings:

```
Group < Subgroup < Project
```

M
Marin Jankovski 已提交
43
This means that you can set a different level of notifications per group while still being able
44
to have a finer level setting per project or subgroup.
M
Marin Jankovski 已提交
45 46
Organization like this is suitable for users that belong to different groups but don't have the
same need for being notified for every group they are member of.
47
These settings can be configured on group page under the name of the group. It will be the dropdown with the bell icon. They can also be configured on the user profile notifications dropdown.
M
Marin Jankovski 已提交
48 49 50

#### Project Settings

51 52
![notification settings](img/notification_project_settings.png)

53
Project Settings are at the top level and any setting placed at this level will take precedence of any
M
Marin Jankovski 已提交
54 55
other setting.
This is suitable for users that have different needs for notifications per project basis.
56
These settings can be configured on project page under the name of the project. It will be the dropdown with the bell icon. They can also be configured on the user profile notifications dropdown.
M
Marin Jankovski 已提交
57 58 59 60 61 62 63 64 65 66 67 68 69

## Notification events

Below is the table of events users can be notified of:

| Event                        | Sent to                                                           | Settings level               |
|------------------------------|-------------------------------------------------------------------|------------------------------|
| New SSH key added            | User                                                              | Security email, always sent. |
| New email added              | User                                                              | Security email, always sent. |
| New user created             | User                                                              | Sent on user creation, except for omniauth (LDAP)|
| User added to project        | User                                                              | Sent when user is added to project |
| Project access level changed | User                                                              | Sent when user project access level is changed |
| User added to group          | User                                                              | Sent when user is added to group |
70
| Group access level changed   | User                                                              | Sent when user group access level is changed |
D
Douwe Maan 已提交
71
| Project moved                | Project members [1]                                               | [1] not disabled |
K
karen Carias 已提交
72

73
### Issue / Merge request events
D
Douwe Maan 已提交
74

75
In most of the below cases, the notification will be sent to:
D
Douwe Maan 已提交
76 77 78
- Participants:
  - the author and assignee of the issue/merge request
  - authors of comments on the issue/merge request
79
  - anyone mentioned by `@username` in the issue/merge request title or description
80 81
  - anyone mentioned by `@username` in any of the comments on the issue/merge request  
     ...with notification level "Participating" or higher
S
Sean McGivern 已提交
82
- Watchers: users with notification level "Watch"
D
Douwe Maan 已提交
83
- Subscribers: anyone who manually subscribed to the issue/merge request
84
- Custom: Users with notification level "custom" who turned on notifications for any of the events present in the table below
D
Douwe Maan 已提交
85 86 87 88 89 90 91

| Event                  | Sent to |
|------------------------|---------|
| New issue              | |
| Close issue            | |
| Reassign issue         | The above, plus the old assignee |
| Reopen issue           | |
92
| Due issue              | Participants and Custom notification level with this event selected |
D
Douwe Maan 已提交
93
| New merge request      | |
94
| Push to merge request  | Participants and Custom notification level with this event selected |
D
Douwe Maan 已提交
95 96 97 98 99
| Reassign merge request | The above, plus the old assignee |
| Close merge request    | |
| Reopen merge request   | |
| Merge merge request    | |
| New comment            | The above, plus anyone mentioned by `@username` in the comment, with notification level "Mention" or higher |
S
Sean McGivern 已提交
100 101
| Failed pipeline        | The author of the pipeline |
| Successful pipeline    | The author of the pipeline, if they have the custom notification setting for successful pipelines set |
K
karen Carias 已提交
102

103 104 105 106
In addition, if the title or description of an Issue or Merge Request is
changed, notifications will be sent to any **new** mentions by `@username` as
if they had been mentioned in the original text.

107 108 109 110
You won't receive notifications for Issues, Merge Requests or Milestones created
by yourself (except when an issue is due). You will only receive automatic
notifications when somebody else comments or adds changes to the ones that
you've created or mentions you.
111

112
If an open merge request becomes unmergeable due to conflict, its author will be notified about the cause.
113 114 115
If a user has also set the merge request to automatically merge once pipeline succeeds,
then that user will also be notified.

116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
### Email Headers

Notification emails include headers that provide extra content about the notification received:

| Header                      | Description                                                             |
|-----------------------------|-------------------------------------------------------------------------|
| X-GitLab-Project            | The name of the project the notification belongs to                     |
| X-GitLab-Project-Id         | The ID of the project                                                   |
| X-GitLab-Project-Path       | The path of the project                                                 |
| X-GitLab-(Resource)-ID      | The ID of the resource the notification is for, where resource is `Issue`, `MergeRequest`, `Commit`, etc|
| X-GitLab-Discussion-ID      | Only in comment emails, the ID of the discussion the comment is from    |
| X-GitLab-Pipeline-Id        | Only in pipeline emails, the ID of the pipeline the notification is for |
| X-GitLab-Reply-Key          | A unique token to support reply by email                                |
| X-GitLab-NotificationReason | The reason for being notified. "mentioned", "assigned", etc             |

#### X-GitLab-NotificationReason
132
This header holds the reason for the notification to have been sent out,
133 134 135 136 137 138 139
where reason can be `mentioned`, `assigned`, `own_activity`, etc.
Only one reason is sent out according to its priority:
- `own_activity`
- `assigned`
- `mentioned`

The reason in this header will also be shown in the footer of the notification email.  For example an email with the
140
reason `assigned` will have this sentence in the footer:
141 142 143 144
`"You are receiving this email because you have been assigned an item on {configured GitLab hostname}"`

**Note: Only reasons listed above have been implemented so far**
Further implementation is [being discussed here](https://gitlab.com/gitlab-org/gitlab-ce/issues/42062)