Commit 2f585840 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fixed new mr/issue emails

parent ecf3b2e4
module Emails module Emails
module Issues module Issues
def new_issue_email(issue_id) def new_issue_email(recipient_id, issue_id)
@issue = Issue.find(issue_id) @issue = Issue.find(issue_id)
@project = @issue.project @project = @issue.project
mail(to: @issue.assignee_email, subject: subject("new issue ##{@issue.id}", @issue.title)) mail(to: recipient(recipient_id), subject: subject("new issue ##{@issue.id}", @issue.title))
end end
def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id) def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id)
......
module Emails module Emails
module MergeRequests module MergeRequests
def new_merge_request_email(merge_request_id) def new_merge_request_email(recipient_id, merge_request_id)
@merge_request = MergeRequest.find(merge_request_id) @merge_request = MergeRequest.find(merge_request_id)
@project = @merge_request.project @project = @merge_request.project
mail(to: @merge_request.assignee_email, subject: subject("new merge request !#{@merge_request.id}", @merge_request.title)) mail(to: recipient(recipient_id), subject: subject("new merge request !#{@merge_request.id}", @merge_request.title))
end end
def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id) def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id)
......
%p %p
New Issue was created and assigned to you. New Issue was created.
%p %p
= "Issue ##{@issue.id}" = "Issue ##{@issue.id}"
= link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title = link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title
%p
Author: #{@issue.author_name}
%p
Assignee: #{@issue.assignee_name}
New Issue was created and assigned to you. New Issue was created.
Issue <%= @issue.id %>: <%= url_for(project_issue_url(@issue.project, @issue)) %> Issue <%= @issue.id %>: <%= url_for(project_issue_url(@issue.project, @issue)) %>
Author: <%= @issue.author_name %>
Asignee: <%= @issue.assignee_name %>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment