Patch #2406
closedIn email notification, send a email with sender as author
Added by Kihyun Yun almost 16 years ago. Updated almost 12 years ago.
0%
Description
When notification email is generated, I want to fill email sender with the author of issue, document, attachment.
In my environment, tons of email message is delivered in a day. If this feature is implemented, I can filter email messages without reading who generate changes. It makes communication more effective.
It is possible for users who received notification emails to define their own email message filters using "X-Redmine-XXX" headers. That is, there is no need the sender must be redmine@yourdomain.com.
In attached patch, I implemented what i want, which are also tested successfully.
Document object does not have any author attribute. So I implemented it with attachment object.
Files
app_models_mailer.rb.diff (2.61 KB) app_models_mailer.rb.diff | Kihyun Yun, 2008-12-29 06:19 | ||
redmine-1.0.1-mail_from_pattern.patch (5.41 KB) redmine-1.0.1-mail_from_pattern.patch | Patch for mail_from pattern | Daniel M, 2010-09-07 20:41 |
Related issues
Updated by Kihyun Yun almost 16 years ago
Sorry, this is not a defect but a new feature.
Updated by Jean-Philippe Lang almost 16 years ago
- Tracker changed from Defect to Patch
Updated by Eric Davis almost 16 years ago
If this is applied, emails sent from Redmine should have the Reply-To field set to the "redmine@domain.com" setting. Otherwise this would really break the Email Receiving on several systems.
Assume email is sent from "redmine@domain.com" and that as an actual email inbox with Email Receiving setup.
- User A updates an issue
- Users B and C get the email update
- User B replies to the email. Since "redmine@domain.com" was the sender, that would be the recipient of the email
- Redmine receives the email and adds an issue note from User B
- Users A and C get the email update
Overriding "To:" would break this process at step 3, requiring User B to manually change the email recipient.
Updated by Kihyun Yun almost 16 years ago
Eric Davis wrote:
If this is applied, emails sent from Redmine should have the Reply-To field set to the "redmine@domain.com" setting. Otherwise this would really break the Email Receiving on several systems.
Assume email is sent from "redmine@domain.com" and that as an actual email inbox with Email Receiving setup.
- User A updates an issue
- Users B and C get the email update
- User B replies to the email. Since "redmine@domain.com" was the sender, that would be the recipient of the email
- Redmine receives the email and adds an issue note from User B
- Users A and C get the email update
Overriding "To:" would break this process at step 3, requiring User B to manually change the email recipient.
Okay.
It is what I didn't care of. As you mentioned about it, "Reply-To:" header should be redmine@domain.com only for Email Receiving enabled systems.
Updated by youngseok yi almost 16 years ago
Eric Davis wrote:
If this is applied, emails sent from Redmine should have the Reply-To field set to the "redmine@domain.com" setting. Otherwise this would really break the Email Receiving on several systems.
What if the mail from redmine composed as follows.
- From : Author of the issue or note
- Reply-To : e-mail for Email Receiving
The notified person can send comment by using 'Reply' of e-mail client.
Most of e-mail client will use Reply-To address to send reply and, it will not include From or CC from original e-mail (this process will not cause duplicate notification)
I think the email with sender as author and reply-to as receiving e-mail will be more clear in most cases. and it will not break the process.
Updated by youngseok yi over 15 years ago
ActionMailer seems to support reply_to (I've checked v2.2.2)
How about to consider this?
setting for administrator could be used also.
- From as issue.author.mail, Reply-To as Setting.mail_from
- From as Setting.mail_from, Reply-To as Setting.mail_from
p.s.
In the patch attached, is it possible to make from as e-mail address with name.
"Order Watcher <watcher@example.com>"
Updated by Gareth Sylvester-Bradley over 14 years ago
We have just migrated to Redmine from the data jail that was Savane and I have to say that this feature is one of the very few things that I miss. Like the OP, I'd like e-mail notifications that I receive about new issues, comments, etc. to appear to come from the author, in order to assist with appropriate filtering in my e-mail client.
Is it possible this feature can be included in the Redmine 1.0 release?
Updated by Daniel M about 14 years ago
Allowing a customized From address is something really useful to have.
I need to have per project from address, so I made a quick patch to be able to replace a token with project id, if that exists.
It adds another field in config file and web interface: mail_from_pattern and if '%%projectid%%' is used in it then is replaced by project id (patch attached, maybe is useful for someone -- my first ruby and remine code, might not be the most optimal way of doing it).
I think the best would be to have this kind of pattern to generate From and Reply-to addresses, then all will be happy, I could see there is another request for using author name in From address: issue #5913.
For example, useful tokens:
- project id and name
- author name and email
Updated by Donald Loflin almost 14 years ago
I want redmine to just put the sender's firstname & lastname in the notification email, but continue
to the use usual sending address.
e.g instead of From: redmine@myredminesystem.com
use From: Donald Loflin <redmine@myredminesystem.com>
Then in email, you'll easily see who it's from, but replies automatically go back to the system. That's how Request Tracker and some others implement it.
Updated by Donald Loflin almost 14 years ago
- Status changed from New to Resolved
Well, I just implemented the way I wanted it - all it took was 2 lines of code:
f = "#{journal.user} <#{Setting.mail_from}>"
from f
Add that into app/models/mailer.rb inside each of the notification functions - e.g issue_add, issue_edit, etc. (probably shouldn't be done for every notification, just certain ones)
In my mailer.rb (v1.0.3), I put that right before "recipients issue.recipients" which is followed by cc(issue.watcher_recipients - @recipients) and the "subject" assignment.
If I knew how to make patches I'd make one...maybe time to learn...
Updated by Donald Loflin almost 14 years ago
Someone wrote me that he couldn't get my mod to work - well, one problem, what I mentioned above only works for issue_edit. In issue_add, you must set "f = #{issue.author} <#{Setting.mail_from}>"
Here's some code snippets from the issue_add and issue_edit functions in mailer.rb, which implement "From: Joe User <redmine@myredmineserver.com>" (ie First/Last changes, but the email address in <>'s is always the defined "mail_from" address).
def issue_add(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 # DLOFLIN add, set from = "user name <sendaddress>" f = "#{issue.author} <#{Setting.mail_from}>" from f # END DLOFLIN def issue_edit(journal) issue = journal.journalized.reload 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 journal references issue @author = journal.user # DLOFLIN add, set from = "user name <sendaddress>" f = "#{journal.user} <#{Setting.mail_from}>" from f # END DLOFLIN
Updated by Jan Niggemann (redmine.org team member) almost 12 years ago
- Status changed from Resolved to Closed
Closing this, status is resolved since 400 days and more (issue was last updated more than 400 days ago)...
Updated by Toshi MARUYAMA over 8 years ago
- Related to Feature #5913: Authors name in from address of email notifications added