use same subject for update and ccreate WP mails

- fixes an issue with WP subject occuring twice on WP create
- this leads to the status being always displayed on update, which I think is only consistent... but a behavioral change indeed
pull/3110/head
Jan Sandbrink 10 years ago
parent 668d1f3ec5
commit 4dc6630470
  1. 16
      app/mailers/user_mailer.rb

@ -59,10 +59,7 @@ class UserMailer < ActionMailer::Base
message_id @issue, user
with_locale_for(user) do
subject = "[#{@issue.project.name} - #{ @issue }]"
subject << " (#{@issue.status.name})" if @issue.status
subject << " #{@issue.subject}"
mail_for_author author, to: user.mail, subject: subject
mail_for_author author, to: user.mail, subject: subject_for_work_package(@issue)
end
end
@ -80,11 +77,7 @@ class UserMailer < ActionMailer::Base
references @issue, user
with_locale_for(user) do
subject = "[#{@issue.project.name} - #{@issue.type.name} ##{@issue.id}] "
subject << "(#{@issue.status.name}) " if @journal.details[:status_id]
subject << @issue.subject
mail_for_author author, to: user.mail, subject: subject
mail_for_author author, to: user.mail, subject: subject_for_work_package(@issue)
end
end
@ -349,6 +342,11 @@ class UserMailer < ActionMailer::Base
private
def subject_for_work_package(work_package)
subject = "[#{work_package.project.name} - #{work_package.type.name} ##{work_package.id}] "
subject << "(#{work_package.status.name}) " << work_package.subject
end
# like #mail, but contains special author based filters
# currently only:
# - remove_self_notifications

Loading…
Cancel
Save