Skip to content

Resolve "Customize notifications for new epic - Web and API"

Mark Chao requested to merge 5863-customize-notifications-for-new-epic into master

The CE port is here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20793

What does this MR do?

Allow custom notification for new epic event, and implement 'new epic' email (including queue/worker/etc).

In the past, all email events are just a constant array NotificationSetting::EMAIL_EVENTS. This is used to list the options in the modal box screenshot below. However there is a need to have group-level specific event (in this case: new_epic), meaning this array can become dynamic. So this MR added a email_events method which can return different events based on input source type.

Currently there are project or group source types (which you can set from https://gitlab.com/profile/notifications). There is also a global notification, where source is nil. So in order to add source-specific events, source is the parameter of NotificationSetting.email_events.

As new_epic is an EE-only group-level event, a EE::NotificationSetting module is created to add new_epic when email_events is called with group source.

After this MR, when clicking on project's custom config, the list will be the same as before. However if group's custom config is opened, the new epic will appear. Also when global custom config is opened, new epic will also be there.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

See #5863 (closed)

Screenshots (if relevant)

CapturFiles_22

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #5863 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports