Skip to content

Add group-level email routing

Wei-Meng Lee requested to merge weimeng-email-routing into master

What does this MR do?

This MR adds settings to configure notification email addresses on a per-group basis.

Relevant issues are #8111 (closed), #55880 (closed).

As a first-pass I added a recipient_context argument to Notify.recipient to allow Project or Group to be passed. I am aware that there are mailers which do not use recipient, will hunt these down if the general approach is judged to be OK.

Also includes a really rough UI to update group notification email addresses. Clearly not final.

Screenshots

Desktop Mobile
Screenshot_2019-03-28_at_10.23.04_AM Screenshot_2019-03-28_at_10.23.39_AM

Migration Output

== 20190327163904 AddNotificationEmailToNotificationSettings: migrating =======
-- add_column(:notification_settings, :notification_email, :string)
   -> 0.0024s
== 20190327163904 AddNotificationEmailToNotificationSettings: migrated (0.0024s)

Database checklist

When adding migrations:

  • Updated db/schema.rb
  • Added a down method so the migration can be reverted
  • Added the output of the migration(s) to the MR body
  • [ ] Added tests for the migration in spec/migrations if necessary (e.g. when migrating data)

When adding or modifying queries to improve performance:

  • [ ] Included data that shows the performance improvement, preferably in the form of a benchmark
  • [ ] Included the output of EXPLAIN (ANALYZE, BUFFERS) of the relevant queries

When adding foreign keys to existing tables:

  • [ ] Included a migration to remove orphaned rows in the source table before adding the foreign key
  • [ ] Removed any instances of dependent: ... that may no longer be necessary

When adding tables:

  • [ ] Ordered columns based on the Ordering Table Columns guidelines
  • [ ] Added foreign keys to any columns pointing to data in other tables
  • [ ] Added indexes for fields that are used in statements such as WHERE, ORDER BY, GROUP BY, and JOINs

When removing columns, tables, indexes or other structures:

  • [ ] Removed these in a post-deployment migration
  • [ ] Made sure the application no longer uses (or ignores) these structures

General checklist

Edited by Wei-Meng Lee

Merge request reports