mail_sender_project.patch

Hans Yoon, 2008-02-03 11:02

Download (2.5 KB)

View differences:

app/models/mailer.rb (working copy)
24 24
  
25 25
  def issue_add(issue)    
26 26
    recipients issue.recipients    
27
    from issue.author.mail if issue.author
28
    headers 'X-redmine-project' => issue.project.identifier
27 29
    subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
28 30
    body :issue => issue,
29 31
         :issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
30 32
  end
31 33

  
32 34
  def issue_edit(journal)
35
    from journal.user.mail if journal.user
33 36
    issue = journal.journalized
37
    headers 'X-redmine-project' => issue.project.identifier
34 38
    recipients issue.recipients
35 39
    # Watchers in cc
36 40
    cc(issue.watcher_recipients - @recipients)
......
41 45
  end
42 46
  
43 47
  def document_added(document)
48
    headers 'X-redmine-project' => document.project.identifier
44 49
    recipients document.project.recipients
45 50
    subject "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
46 51
    body :document => document,
......
48 53
  end
49 54
  
50 55
  def attachments_added(attachments)
56
    #from attachments.author.mail if attachments.author
51 57
    container = attachments.first.container
52 58
    added_to = ''
53 59
    added_to_url = ''
......
61 67
    end
62 68
    recipients container.project.recipients
63 69
    subject "[#{container.project.name}] #{l(:label_attachment_new)}"
70
    headers 'X-redmine-project' => container.project.identifier
64 71
    body :attachments => attachments,
65 72
         :added_to => added_to,
66 73
         :added_to_url => added_to_url
67 74
  end
68 75

  
69 76
  def news_added(news)
77
    from news.author.mail if news.author
78
    headers 'X-redmine-project' => news.project.identifier
70 79
    recipients news.project.recipients
71 80
    subject "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
72 81
    body :news => news,
......
74 83
  end
75 84

  
76 85
  def message_posted(message, recipients)
86
    from message.author.mail if message.author
87
    headers 'X-redmine-project' => message.board.project.identifier
77 88
    recipients(recipients)
78 89
    subject "[#{message.board.project.name} - #{message.board.name}] #{message.subject}"
79 90
    body :message => message,
......
127 138
    from Setting.mail_from
128 139
    default_url_options[:host] = Setting.host_name
129 140
    default_url_options[:protocol] = Setting.protocol
141
    headers 'X-redmine-host' => Setting.host_name
130 142
  end
131 143
  
132 144
  # Overrides the create_mail method