Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
249d08c2
Commit
249d08c2
authored
May 13, 2019
by
Wei-Meng Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Route notifications to groups for EE mailers
parent
e03b7728
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
9 deletions
+6
-9
ee/app/mailers/ee/emails/projects.rb
ee/app/mailers/ee/emails/projects.rb
+3
-6
ee/app/mailers/emails/csv_export.rb
ee/app/mailers/emails/csv_export.rb
+1
-1
ee/app/mailers/emails/epics.rb
ee/app/mailers/emails/epics.rb
+1
-1
ee/app/mailers/emails/reviews.rb
ee/app/mailers/emails/reviews.rb
+1
-1
No files found.
ee/app/mailers/ee/emails/projects.rb
View file @
249d08c2
...
...
@@ -5,24 +5,21 @@ module EE
module
Projects
def
mirror_was_hard_failed_email
(
project_id
,
user_id
)
@project
=
::
Project
.
find
(
project_id
)
user
=
::
User
.
find
(
user_id
)
mail
(
to:
user
.
notification_email
,
mail
(
to:
recipient
(
user_id
,
@project
.
group
)
,
subject:
subject
(
'Repository mirroring paused'
))
end
def
project_mirror_user_changed_email
(
new_mirror_user_id
,
deleted_user_name
,
project_id
)
@project
=
::
Project
.
find
(
project_id
)
@deleted_user_name
=
deleted_user_name
new_mirror_user
=
::
User
.
find
(
new_mirror_user_id
)
mail
(
to:
new_mirror_user
.
notification_email
,
mail
(
to:
recipient
(
new_mirror_user_id
,
@project
.
group
)
,
subject:
subject
(
'Mirror user changed'
))
end
def
prometheus_alert_fired_email
(
project_id
,
user_id
,
alert_payload
)
@project
=
::
Project
.
find
(
project_id
)
user
=
::
User
.
find
(
user_id
)
@alert
=
::
Gitlab
::
Alerting
::
Alert
.
new
(
project:
@project
,
payload:
alert_payload
)
...
...
@@ -30,7 +27,7 @@ module EE
return
unless
@alert
.
valid?
subject_text
=
"Alert:
#{
@alert
.
email_subject
}
"
mail
(
to:
user
.
notification_email
,
subject:
subject
(
subject_text
))
mail
(
to:
recipient
(
user_id
,
@project
.
group
)
,
subject:
subject
(
subject_text
))
end
end
end
...
...
ee/app/mailers/emails/csv_export.rb
View file @
249d08c2
...
...
@@ -10,7 +10,7 @@ module Emails
filename
=
"
#{
project
.
full_path
.
parameterize
}
_issues_
#{
Date
.
today
.
iso8601
}
.csv"
attachments
[
filename
]
=
{
content:
csv_data
,
mime_type:
'text/csv'
}
mail
(
to:
user
.
notification_email
,
subject:
subject
(
"Exported issues"
))
do
|
format
|
mail
(
to:
recipient
(
user
.
id
,
@project
.
group
)
,
subject:
subject
(
"Exported issues"
))
do
|
format
|
format
.
html
{
render
layout:
'mailer'
}
format
.
text
{
render
layout:
'mailer'
}
end
...
...
ee/app/mailers/emails/epics.rb
View file @
249d08c2
...
...
@@ -35,7 +35,7 @@ module Emails
def
epic_thread_options
(
sender_id
,
recipient_id
,
reason
)
{
from:
sender
(
sender_id
),
to:
recipient
(
recipient_id
),
to:
recipient
(
recipient_id
,
@epic
.
group
),
subject:
subject
(
"
#{
@epic
.
title
}
(
#{
@epic
.
to_reference
}
)"
),
'X-GitLab-NotificationReason'
=>
reason
}
...
...
ee/app/mailers/emails/reviews.rb
View file @
249d08c2
...
...
@@ -13,7 +13,7 @@ module Emails
def
review_thread_options
(
recipient_id
)
{
from:
sender
(
@author
.
id
),
to:
recipient
(
recipient_id
),
to:
recipient
(
recipient_id
,
@merge_request
.
target_project
.
group
),
subject:
subject
(
"
#{
@merge_request
.
title
}
(
#{
@merge_request
.
to_reference
}
)"
)
}
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment