2013-03-19 14:00:41 -04:00
|
|
|
module Emails
|
|
|
|
module Issues
|
2013-03-28 06:52:44 -04:00
|
|
|
def new_issue_email(recipient_id, issue_id)
|
2013-03-19 14:00:41 -04:00
|
|
|
@issue = Issue.find(issue_id)
|
|
|
|
@project = @issue.project
|
2014-02-18 05:12:01 -05:00
|
|
|
@target_url = project_issue_url(@project, @issue)
|
2014-06-18 07:41:12 -04:00
|
|
|
set_message_id("issue_#{issue_id}")
|
|
|
|
mail(from: sender(@issue.author_id),
|
|
|
|
to: recipient(recipient_id),
|
|
|
|
subject: subject("#{@issue.title} (##{@issue.iid})"))
|
2013-03-19 14:00:41 -04:00
|
|
|
end
|
|
|
|
|
2014-02-17 12:49:42 -05:00
|
|
|
def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id, updated_by_user_id)
|
2013-03-19 14:00:41 -04:00
|
|
|
@issue = Issue.find(issue_id)
|
2014-01-19 13:55:59 -05:00
|
|
|
@previous_assignee = User.find_by(id: previous_assignee_id) if previous_assignee_id
|
2013-03-19 14:00:41 -04:00
|
|
|
@project = @issue.project
|
2014-02-18 05:12:01 -05:00
|
|
|
@target_url = project_issue_url(@project, @issue)
|
2014-06-18 07:41:12 -04:00
|
|
|
set_reference("issue_#{issue_id}")
|
|
|
|
mail(from: sender(updated_by_user_id),
|
|
|
|
to: recipient(recipient_id),
|
|
|
|
subject: subject("#{@issue.title} (##{@issue.iid})"))
|
2013-03-19 14:00:41 -04:00
|
|
|
end
|
|
|
|
|
2013-03-28 06:24:04 -04:00
|
|
|
def closed_issue_email(recipient_id, issue_id, updated_by_user_id)
|
2013-03-28 06:14:53 -04:00
|
|
|
@issue = Issue.find issue_id
|
|
|
|
@project = @issue.project
|
|
|
|
@updated_by = User.find updated_by_user_id
|
2014-02-18 05:12:01 -05:00
|
|
|
@target_url = project_issue_url(@project, @issue)
|
2014-06-18 07:41:12 -04:00
|
|
|
set_reference("issue_#{issue_id}")
|
|
|
|
mail(from: sender(updated_by_user_id),
|
|
|
|
to: recipient(recipient_id),
|
|
|
|
subject: subject("#{@issue.title} (##{@issue.iid})"))
|
2013-03-28 06:14:53 -04:00
|
|
|
end
|
|
|
|
|
2013-03-19 14:00:41 -04:00
|
|
|
def issue_status_changed_email(recipient_id, issue_id, status, updated_by_user_id)
|
|
|
|
@issue = Issue.find issue_id
|
|
|
|
@issue_status = status
|
|
|
|
@project = @issue.project
|
|
|
|
@updated_by = User.find updated_by_user_id
|
2014-02-18 05:12:01 -05:00
|
|
|
@target_url = project_issue_url(@project, @issue)
|
2014-06-18 07:41:12 -04:00
|
|
|
set_reference("issue_#{issue_id}")
|
|
|
|
mail(from: sender(updated_by_user_id),
|
|
|
|
to: recipient(recipient_id),
|
|
|
|
subject: subject("#{@issue.title} (##{@issue.iid})"))
|
2013-03-19 14:00:41 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|