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
33709d43
Commit
33709d43
authored
May 18, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minimize CE/EE diff in Notify
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
cb8118df
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
46 deletions
+44
-46
app/mailers/notify.rb
app/mailers/notify.rb
+1
-5
ee/app/mailers/ee/notify.rb
ee/app/mailers/ee/notify.rb
+4
-0
ee/app/mailers/emails/ee/service_desk.rb
ee/app/mailers/emails/ee/service_desk.rb
+0
-41
ee/app/mailers/emails/service_desk.rb
ee/app/mailers/emails/service_desk.rb
+39
-0
No files found.
app/mailers/notify.rb
View file @
33709d43
class
Notify
<
BaseMailer
prepend
EE
::
Notify
prepend
::
EE
::
Notify
include
ActionDispatch
::
Routing
::
PolymorphicRoutes
include
GitlabRoutingHelper
include
Emails
::
AdminNotification
include
Emails
::
Issues
include
Emails
::
CsvExport
include
Emails
::
MergeRequests
include
Emails
::
Notes
include
Emails
::
PagesDomains
...
...
@@ -15,8 +13,6 @@ class Notify < BaseMailer
include
Emails
::
Pipelines
include
Emails
::
Members
include
Emails
::
EE
::
ServiceDesk
helper
MergeRequestsHelper
helper
DiffHelper
helper
BlobHelper
...
...
ee/app/mailers/ee/notify.rb
View file @
33709d43
...
...
@@ -4,6 +4,10 @@ module EE
extend
::
Gitlab
::
Utils
::
Override
included
do
include
::
Emails
::
AdminNotification
include
::
Emails
::
CsvExport
include
::
Emails
::
ServiceDesk
attr_reader
:group
end
...
...
ee/app/mailers/emails/ee/service_desk.rb
deleted
100644 → 0
View file @
cb8118df
module
Emails
module
EE
module
ServiceDesk
extend
ActiveSupport
::
Concern
included
do
layout
'service_desk'
,
only:
[
:service_desk_thank_you_email
,
:service_desk_new_note_email
]
end
def
service_desk_thank_you_email
(
issue_id
)
setup_service_desk_mail
(
issue_id
)
mail_new_thread
(
@issue
,
service_desk_options
(
@support_bot
.
id
))
end
def
service_desk_new_note_email
(
issue_id
,
note_id
)
@note
=
Note
.
find
(
note_id
)
setup_service_desk_mail
(
issue_id
)
mail_answer_thread
(
@issue
,
service_desk_options
(
@note
.
author_id
))
end
private
def
setup_service_desk_mail
(
issue_id
)
@issue
=
Issue
.
find
(
issue_id
)
@project
=
@issue
.
project
@support_bot
=
User
.
support_bot
@sent_notification
=
SentNotification
.
record
(
@issue
,
@support_bot
.
id
,
reply_key
)
end
def
service_desk_options
(
author_id
)
{
from:
sender
(
author_id
),
to:
@issue
.
service_desk_reply_to
,
subject:
"Re:
#{
@issue
.
title
}
(#
#{
@issue
.
iid
}
)"
}
end
end
end
end
ee/app/mailers/emails/service_desk.rb
0 → 100644
View file @
33709d43
module
Emails
module
ServiceDesk
extend
ActiveSupport
::
Concern
included
do
layout
'service_desk'
,
only:
[
:service_desk_thank_you_email
,
:service_desk_new_note_email
]
end
def
service_desk_thank_you_email
(
issue_id
)
setup_service_desk_mail
(
issue_id
)
mail_new_thread
(
@issue
,
service_desk_options
(
@support_bot
.
id
))
end
def
service_desk_new_note_email
(
issue_id
,
note_id
)
@note
=
Note
.
find
(
note_id
)
setup_service_desk_mail
(
issue_id
)
mail_answer_thread
(
@issue
,
service_desk_options
(
@note
.
author_id
))
end
private
def
setup_service_desk_mail
(
issue_id
)
@issue
=
Issue
.
find
(
issue_id
)
@project
=
@issue
.
project
@support_bot
=
User
.
support_bot
@sent_notification
=
SentNotification
.
record
(
@issue
,
@support_bot
.
id
,
reply_key
)
end
def
service_desk_options
(
author_id
)
{
from:
sender
(
author_id
),
to:
@issue
.
service_desk_reply_to
,
subject:
"Re:
#{
@issue
.
title
}
(#
#{
@issue
.
iid
}
)"
}
end
end
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