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
|
2013-11-08 10:04:36 -05:00
|
|
|
mail(to: recipient(recipient_id), subject: subject("New issue ##{@issue.iid}", @issue.title))
|
2013-03-19 14:00:41 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id)
|
|
|
|
@issue = Issue.find(issue_id)
|
2013-07-01 12:01:19 -04: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
|
2013-11-08 10:04:36 -05:00
|
|
|
mail(to: recipient(recipient_id), subject: subject("Changed issue ##{@issue.iid}", @issue.title))
|
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
|
|
|
|
mail(to: recipient(recipient_id),
|
2013-08-22 08:40:48 -04:00
|
|
|
subject: subject("Closed issue ##{@issue.iid}", @issue.title))
|
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
|
|
|
|
mail(to: recipient(recipient_id),
|
2013-11-08 10:04:36 -05:00
|
|
|
subject: subject("Changed issue ##{@issue.iid}", @issue.title))
|
2013-03-19 14:00:41 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|