Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
c5b13cc9
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c5b13cc9
编写于
8月 20, 2012
作者:
R
Robert Speicher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove more duplication in the Notify mailer
上级
652d955c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
14 deletion
+18
-14
app/mailers/notify.rb
app/mailers/notify.rb
+18
-14
未找到文件。
app/mailers/notify.rb
浏览文件 @
c5b13cc9
...
...
@@ -22,43 +22,38 @@ class Notify < ActionMailer::Base
end
def
note_wall_email
(
recipient_id
,
note_id
)
recipient
=
User
.
find
(
recipient_id
)
@note
=
Note
.
find
(
note_id
)
@project
=
@note
.
project
mail
(
to:
recipient
.
email
,
subject:
subject
)
mail
(
to:
recipient
(
recipient_id
)
,
subject:
subject
)
end
def
note_commit_email
(
recipient_id
,
note_id
)
recipient
=
User
.
find
(
recipient_id
)
@note
=
Note
.
find
(
note_id
)
@commit
=
@note
.
target
@commit
=
CommitDecorator
.
decorate
(
@commit
)
@project
=
@note
.
project
mail
(
to:
recipient
.
email
,
subject:
subject
(
"note for commit
#{
@commit
.
short_id
}
"
,
@commit
.
title
))
mail
(
to:
recipient
(
recipient_id
)
,
subject:
subject
(
"note for commit
#{
@commit
.
short_id
}
"
,
@commit
.
title
))
end
def
note_merge_request_email
(
recipient_id
,
note_id
)
recipient
=
User
.
find
(
recipient_id
)
@note
=
Note
.
find
(
note_id
)
@merge_request
=
@note
.
noteable
@project
=
@note
.
project
mail
(
to:
recipient
.
email
,
subject:
subject
(
"note for merge request !
#{
@merge_request
.
id
}
"
))
mail
(
to:
recipient
(
recipient_id
)
,
subject:
subject
(
"note for merge request !
#{
@merge_request
.
id
}
"
))
end
def
note_issue_email
(
recipient_id
,
note_id
)
recipient
=
User
.
find
(
recipient_id
)
@note
=
Note
.
find
(
note_id
)
@issue
=
@note
.
noteable
@project
=
@note
.
project
mail
(
to:
recipient
.
email
,
subject:
subject
(
"note for issue #
#{
@issue
.
id
}
"
))
mail
(
to:
recipient
(
recipient_id
)
,
subject:
subject
(
"note for issue #
#{
@issue
.
id
}
"
))
end
def
note_wiki_email
(
recipient_id
,
note_id
)
recipient
=
User
.
find
(
recipient_id
)
@note
=
Note
.
find
(
note_id
)
@wiki
=
@note
.
noteable
@project
=
@note
.
project
mail
(
to:
recipient
.
email
,
subject:
subject
(
"note for wiki"
))
mail
(
to:
recipient
(
recipient_id
)
,
subject:
subject
(
"note for wiki"
))
end
def
new_merge_request_email
(
merge_request_id
)
...
...
@@ -68,23 +63,32 @@ class Notify < ActionMailer::Base
end
def
reassigned_merge_request_email
(
recipient_id
,
merge_request_id
,
previous_assignee_id
)
recipient
=
User
.
find
(
recipient_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@previous_assignee
||=
User
.
find
(
previous_assignee_id
)
@project
=
@merge_request
.
project
mail
(
to:
recipient
.
email
,
subject:
subject
(
"changed merge request !
#{
@merge_request
.
id
}
"
,
@merge_request
.
title
))
mail
(
to:
recipient
(
recipient_id
)
,
subject:
subject
(
"changed merge request !
#{
@merge_request
.
id
}
"
,
@merge_request
.
title
))
end
def
reassigned_issue_email
(
recipient_id
,
issue_id
,
previous_assignee_id
)
recipient
=
User
.
find
(
recipient_id
)
@issue
=
Issue
.
find
(
issue_id
)
@previous_assignee
||=
User
.
find
(
previous_assignee_id
)
@project
=
@issue
.
project
mail
(
to:
recipient
.
email
,
subject:
subject
(
"changed issue #
#{
@issue
.
id
}
"
,
@issue
.
title
))
mail
(
to:
recipient
(
recipient_id
)
,
subject:
subject
(
"changed issue #
#{
@issue
.
id
}
"
,
@issue
.
title
))
end
private
# Look up a User by their ID and return their email address
#
# recipient_id - User ID
#
# Returns a String containing the User's email address.
def
recipient
(
recipient_id
)
if
recipient
=
User
.
find
(
recipient_id
)
recipient
.
email
end
end
# Formats arguments into a String suitable for use as an email subject
#
# extra - Extra Strings to be inserted into the subject
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录