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
a251b8f6
Commit
a251b8f6
authored
Jul 10, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move EE specific preview to its own module
parent
6902a422
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
52 deletions
+61
-52
app/mailers/previews/notify_preview.rb
app/mailers/previews/notify_preview.rb
+2
-52
ee/app/mailers/preview/notify_preview.rb
ee/app/mailers/preview/notify_preview.rb
+59
-0
No files found.
app/mailers/previews/notify_preview.rb
View file @
a251b8f6
class
NotifyPreview
<
ActionMailer
::
Preview
prepend
EE
::
NotifyPreview
def
note_merge_request_email_for_individual_note
note_email
(
:note_merge_request_email
)
do
note
=
<<-
MD
.
strip_heredoc
...
...
@@ -123,52 +125,6 @@ class NotifyPreview < ActionMailer::Preview
Notify
.
pipeline_failed_email
(
pipeline
,
pipeline
.
user
.
try
(
:email
))
end
# EE-specific start
def
add_merge_request_approver_email
Notify
.
add_merge_request_approver_email
(
user
.
id
,
merge_request
.
id
,
user
.
id
).
message
end
def
issues_csv_email
Notify
.
issues_csv_email
(
user
,
project
,
'1997,Ford,E350'
,
{
truncated:
false
,
rows_expected:
3
,
rows_written:
3
}).
message
end
def
approved_merge_request_email
Notify
.
approved_merge_request_email
(
user
.
id
,
merge_request
.
id
,
approver
.
id
).
message
end
def
unapproved_merge_request_email
Notify
.
unapproved_merge_request_email
(
user
.
id
,
merge_request
.
id
,
approver
.
id
).
message
end
def
mirror_was_hard_failed_email
Notify
.
mirror_was_hard_failed_email
(
project
.
id
,
user
.
id
).
message
end
def
project_mirror_user_changed_email
Notify
.
project_mirror_user_changed_email
(
user
.
id
,
'deleted_user_name'
,
project
.
id
).
message
end
def
send_admin_notification
Notify
.
send_admin_notification
(
user
.
id
,
'Email subject from admin'
,
'Email body from admin'
).
message
end
def
send_unsubscribed_notification
Notify
.
send_unsubscribed_notification
(
user
.
id
).
message
end
def
service_desk_new_note_email
cleanup
do
note
=
create_note
(
noteable_type:
'Issue'
,
noteable_id:
issue
.
id
,
note:
'Issue note content'
)
Notify
.
service_desk_new_note_email
(
issue
.
id
,
note
.
id
).
message
end
end
def
service_desk_thank_you_email
Notify
.
service_desk_thank_you_email
(
issue
.
id
).
message
end
# EE-specific end
private
def
project
...
...
@@ -213,10 +169,4 @@ class NotifyPreview < ActionMailer::Preview
email
end
# EE-specific start
def
approver
@user
||=
User
.
first
end
# EE-specific end
end
ee/app/mailers/preview/notify_preview.rb
0 → 100644
View file @
a251b8f6
module
EE
module
NotifyPreview
extend
ActiveSupport
::
Concern
# We need to define the methods on the prepender directly because:
# https://github.com/rails/rails/blob/3faf7485623da55215d6d7f3dcb2eed92c59c699/actionmailer/lib/action_mailer/preview.rb#L73
prepended
do
def
add_merge_request_approver_email
Notify
.
add_merge_request_approver_email
(
user
.
id
,
merge_request
.
id
,
user
.
id
).
message
end
def
issues_csv_email
Notify
.
issues_csv_email
(
user
,
project
,
'1997,Ford,E350'
,
{
truncated:
false
,
rows_expected:
3
,
rows_written:
3
}).
message
end
def
approved_merge_request_email
Notify
.
approved_merge_request_email
(
user
.
id
,
merge_request
.
id
,
approver
.
id
).
message
end
def
unapproved_merge_request_email
Notify
.
unapproved_merge_request_email
(
user
.
id
,
merge_request
.
id
,
approver
.
id
).
message
end
def
mirror_was_hard_failed_email
Notify
.
mirror_was_hard_failed_email
(
project
.
id
,
user
.
id
).
message
end
def
project_mirror_user_changed_email
Notify
.
project_mirror_user_changed_email
(
user
.
id
,
'deleted_user_name'
,
project
.
id
).
message
end
def
send_admin_notification
Notify
.
send_admin_notification
(
user
.
id
,
'Email subject from admin'
,
'Email body from admin'
).
message
end
def
send_unsubscribed_notification
Notify
.
send_unsubscribed_notification
(
user
.
id
).
message
end
def
service_desk_new_note_email
cleanup
do
note
=
create_note
(
noteable_type:
'Issue'
,
noteable_id:
issue
.
id
,
note:
'Issue note content'
)
Notify
.
service_desk_new_note_email
(
issue
.
id
,
note
.
id
).
message
end
end
def
service_desk_thank_you_email
Notify
.
service_desk_thank_you_email
(
issue
.
id
).
message
end
end
private
def
approver
@user
||=
User
.
first
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