Project

General

Profile

RE: email notification for every commit and https ยป commit_notification.patch

Commit Referenced Issue Notification. - James Linse, 2012-11-15 07:59

View differences:

app/models/mailer.rb (working copy)
:subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
end
# Builds a Mail::Message object used to email recipients of the issues addressed in the chagneset.
#
# Example:
# issue_changeset(changeset, issue) => Mail::Message object
# Mailer.issue_changeset(changeset, issue).deliver => sends an email to issue recipients
def issue_changeset(changeset, issue)
redmine_headers 'Project' => issue.project.identifier,
'Issue-Id' => issue.id,
'Issue-Author' => issue.author.login
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
message_id issue
references issue
@author = changeset.user
recipients = issue.recipients
# Watchers in cc
cc = issue.watcher_recipients - recipients
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
s << issue.subject
s << " - Commit By #{changeset.user} [R#{changeset.revision}]"
@issue = issue
@changeset = changeset
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue)
mail(:to => recipients, :cc => cc, :subject => s)
end
# Builds a Mail::Message object used to email recipients of the edited issue.
#
# Example:
app/models/changeset.rb (working copy)
referenced_issues.uniq!
self.issues = referenced_issues unless referenced_issues.empty?
self.issues.each do |issue|
Mailer.issue_changeset(self, issue).deliver if !referenced_issues.empty? && Setting.notified_events.include?('issue_updated')
end
end
def short_comments
app/views/mailer/issue_changeset.html.erb (revision 0)
<%= l(:text_issue_updated, :id => "##{@issue.id}", :author => h(@author)) %>
<hr />
<%= textilizable(@changeset, :comments, :only_path => false) %>
<hr />
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
app/views/mailer/issue_changeset.text.erb (revision 0)
<%= l(:text_issue_updated, :id => "##{@issue.id}", :author => @author) %>
----------------------------------------
<%= textilizable(@changeset.comments) %>
----------------------------------------
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
    (1-1/1)