2013-03-19 19:00:41 +01:00
|
|
|
module Emails
|
|
|
|
module MergeRequests
|
2013-03-28 11:52:44 +01:00
|
|
|
def new_merge_request_email(recipient_id, merge_request_id)
|
2013-03-19 19:00:41 +01:00
|
|
|
@merge_request = MergeRequest.find(merge_request_id)
|
|
|
|
@project = @merge_request.project
|
2013-03-28 11:52:44 +01:00
|
|
|
mail(to: recipient(recipient_id), subject: subject("new merge request !#{@merge_request.id}", @merge_request.title))
|
2013-03-19 19:00:41 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id)
|
|
|
|
@merge_request = MergeRequest.find(merge_request_id)
|
|
|
|
@previous_assignee ||= User.find(previous_assignee_id)
|
|
|
|
@project = @merge_request.project
|
|
|
|
mail(to: recipient(recipient_id), subject: subject("changed merge request !#{@merge_request.id}", @merge_request.title))
|
|
|
|
end
|
2013-03-28 11:14:53 +01:00
|
|
|
|
|
|
|
def closed_merge_request_email(recipient_id, merge_request_id, updated_by_user_id)
|
|
|
|
@merge_request = MergeRequest.find(merge_request_id)
|
|
|
|
@project = @merge_request.project
|
|
|
|
@updated_by = User.find updated_by_user_id
|
|
|
|
mail(to: recipient(recipient_id), subject: subject("Closed merge request !#{@merge_request.id}", @merge_request.title))
|
|
|
|
end
|
|
|
|
|
|
|
|
def merged_merge_request_email(recipient_id, merge_request_id)
|
|
|
|
@merge_request = MergeRequest.find(merge_request_id)
|
|
|
|
@project = @merge_request.project
|
|
|
|
mail(to: recipient(recipient_id), subject: subject("Accepted merge request !#{@merge_request.id}", @merge_request.title))
|
|
|
|
end
|
2013-03-19 19:00:41 +01:00
|
|
|
end
|
|
|
|
end
|