Defect #13656
closed
Notify email - unable to make custom subject
Added by Pavel Potcheptsov over 11 years ago.
Updated over 11 years ago.
Category:
Email notifications
Description
I posted this question in forum early: http://www.redmine.org/boards/2/topics/37090?r=37137#message-37137
Status field in email cause broke email's chains by subject.
And bottom changes remove Status field from email subject.
But after applying it in 2.3.0 field Status still present in subject, why?
Index: app/models/mailer.rb
===================================================================
--- app/models/mailer.rb (revision 11050)
+++ app/models/mailer.rb (working copy)
@@ -45,7 +45,8 @@
cc = issue.watcher_recipients - recipients
mail :to => recipients,
:cc => cc,
- :subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
+ #:subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
+ :subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.subject}"
end
# Builds a Mail::Message object used to email recipients of the edited issue.
@@ -66,7 +67,7 @@
# Watchers in cc
cc = journal.watcher_recipients - recipients
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
- s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
+ #s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
s << issue.subject
@issue = issue
@journal = journal
Than I made such line:
:subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}]"
and restart RM and received email:
[IT Help Desk - Task #11112] (Assigned) test issue
[IT Help Desk - Task #11112] (Assigned) test isuuse
not config email server :
config/configuration.yml
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
enable_starttls_auto: true
address: "smtp.gmail.com"
port: '587'
domain: "smtp.gmail.com"
authentication: :plain
user_name: "tiengiangtech79@gmail.com"
password: "abc123"
- Status changed from New to Closed
- Resolution set to Invalid
Pavel Potcheptsov wrote:
and what is it?
An unrelated post.
Not sure you're applying your post on the right file because mailer.rb
revision for 2.3.0 is r11454, not r11050 as your patch excerpt stipulates.
I close the issue because it's neither a Defect nor a Feature request.
- Status changed from Closed to Reopened
ok. I just provide stored diff from previous version. does this change something:
[root@redmine rm2.3.0]# svn diff
Index: app/models/mailer.rb
===================================================================
--- app/models/mailer.rb (revision 11670)
+++ app/models/mailer.rb (working copy)
@@ -45,7 +45,8 @@
cc = issue.watcher_recipients - recipients
mail :to => recipients,
:cc => cc,
- :subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
+ :subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}]"
+ #:subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.subject}"
end
# Builds a Mail::Message object used to email recipients of the edited issue.
@@ -66,7 +67,6 @@
# Watchers in cc
cc = journal.watcher_recipients - recipients
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
- s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
s << issue.subject
@issue = issue
@journal = journal
@@ -87,6 +87,17 @@
:subject => l(:mail_subject_reminder, :count => issues.size, :days => days)
end
- Status changed from Reopened to Closed
r11670 is too recent to be 2.3.0, as you can see in source:/tags/2.3.0/app/models/mailer.rb, your file should be r11454 or r11661.
Please state clear what version you're using and if you "checkouted" it from repository or whatever.
Please don't reopen this issue as it is not a bug and it doesn't make sense to have it open.
This doesn't mean we can't discuss here (even if this would be better in forum).
Last but not least word, your patch seems right, what I doubt is that you're modifying the right file.
Ok, ./rm2.3.0 it's my current working RM, that I just checkouted from svn some times ago and than edited mailer.rb to prevent composing email with field "Status" in Subject.
[root@redmine www]# cd ./rm2.3.0/
[root@redmine rm2.3.0]# svn info
Path: .
URL: http://svn.redmine.org/redmine/branches/2.3-stable
Repository Root: http://svn.redmine.org/redmine
Repository UUID: e93f8b46-1217-0410-a6f0-8f06a7374b81
Revision: 11670
Node Kind: directory
Schedule: normal
Last Changed Author: tmaruyama
Last Changed Rev: 11669
Last Changed Date: 2013-03-20 08:01:37 +0100 (Wed, 20 Mar 2013)
[root@redmine rm2.3.0]# cd ..
[root@redmine www]# svn co http://svn.redmine.org/redmine/branches/2.3-stable redmine-2.3
A redmine-2.3/test
....
....skipped
....
Checked out revision 11695.
[root@redmine www]# cd redmine-2.3/
[root@redmine redmine-2.3]# svn info
Path: .
URL: http://svn.redmine.org/redmine/branches/2.3-stable
Repository Root: http://svn.redmine.org/redmine
Repository UUID: e93f8b46-1217-0410-a6f0-8f06a7374b81
Revision: 11695
Node Kind: directory
Schedule: normal
Last Changed Author: emassip
Last Changed Rev: 11695
Last Changed Date: 2013-04-02 19:50:39 +0200 (Tue, 02 Apr 2013)
[root@redmine redmine-2.3]#
And you're running Apache+Passenger over /redmine-2.3 with above mentioned patch applied and still have the issue?
No, I use Nginx+Unicorn and local sendmail.
But I don't think that web-server or mail delivery option affect to composing email.
I have some plugin installed, but also, how do they affect to mailer.rb?
I'll try to apply patch on clear checkouted redmine and will report for result.
Environment:
Redmine version 2.3.0.stable.11670
Ruby version 1.9.3 (i686-linux)
Rails version 3.2.13
Environment production
Database adapter Mysql2
Redmine plugins:
planner 0.4
redmine_drafts 0.2.0
redmine_fields_permissions 1.0.0
redmine_hide_estimated_hours 1.0.3
redmine_knowledgebase 2.2.0
redmine_lightbox 0.0.1
redmine_monitoring_controlling 0.1.1
redmine_timesheet_plugin 0.7.0
Pavel Potcheptsov wrote:
No, I use Nginx+Unicorn and local sendmail.
But I don't think that web-server or mail delivery option affect to composing email.
No, it's only to understand your setup.
I have some plugin installed, but also, how do they affect to mailer.rb?
A plugin may override part of the mailer implementation and it's very likely in your case since your patch is OK.
Thanks for your answer, I did fresh installation on the same host without any plugin, applied mail patch and it works!
I guess that it's Planner plugin, but I can't uninstall it. I don't have experience to answer why, but after compare with another plugin I found that Planner doesn't have options to delete his mysql records:
https://github.com/dr-itz/RedminePlannerPlugin/tree/master/db/migrate
Am I right?
So to delete plugin I should manually delete all his tables from database?
Also available in: Atom
PDF