Project

General

Profile

Actions

Patch #2406

closed

In email notification, send a email with sender as author

Added by Kihyun Yun about 15 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email notifications
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

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 .

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

Related to Redmine - Feature #241: Mailer sender is set as event initiatorClosed

Actions
Related to Redmine - Patch #247: Notification mail sender is the author and includes project information.New

Actions
Related to Redmine - Feature #5913: Authors name in from address of email notificationsClosedGo MAEDA2010-07-20

Actions
Actions #1

Updated by Kihyun Yun about 15 years ago

Sorry, this is not a defect but a new feature.

Actions #2

Updated by Jean-Philippe Lang about 15 years ago

  • Tracker changed from Defect to Patch
Actions #3

Updated by Eric Davis about 15 years ago

If this is applied, emails sent from Redmine should have the Reply-To field set to the "" setting. Otherwise this would really break the Email Receiving on several systems.

Assume email is sent from "" and that as an actual email inbox with Email Receiving setup.

  1. User A updates an issue
  2. Users B and C get the email update
  3. User B replies to the email. Since "" was the sender, that would be the recipient of the email
  4. Redmine receives the email and adds an issue note from User B
  5. 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.

Actions #4

Updated by Kihyun Yun about 15 years ago

Eric Davis wrote:

If this is applied, emails sent from Redmine should have the Reply-To field set to the "" setting. Otherwise this would really break the Email Receiving on several systems.

Assume email is sent from "" and that as an actual email inbox with Email Receiving setup.

  1. User A updates an issue
  2. Users B and C get the email update
  3. User B replies to the email. Since "" was the sender, that would be the recipient of the email
  4. Redmine receives the email and adds an issue note from User B
  5. 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 only for Email Receiving enabled systems.

Actions #5

Updated by youngseok yi about 15 years ago

Eric Davis wrote:

If this is applied, emails sent from Redmine should have the Reply-To field set to the "" setting. Otherwise this would really break the Email Receiving on several systems.

What if the mail from redmine composed as follows.

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.

Actions #6

Updated by youngseok yi almost 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>"

Actions #7

Updated by Gareth Sylvester-Bradley almost 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?

Actions #8

Updated by Daniel M over 13 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

Actions #9

Updated by Donald Loflin over 13 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:
use From: Donald Loflin <>

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.

Actions #10

Updated by Donald Loflin over 13 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...

Actions #11

Updated by Donald Loflin about 13 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 <>" (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

Actions #12

Updated by Jan Niggemann (redmine.org team member) about 11 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)...

Actions #13

Updated by Toshi MARUYAMA over 7 years ago

  • Related to Feature #5913: Authors name in from address of email notifications added
Actions

Also available in: Atom PDF