Project

General

Profile

Feature #5913 » app_models_mailer.rb.diff

worked on 0.85 - Tudor Spinache, 2010-11-03 11:51

View differences:

app/models/mailer.rb (working copy)
28 28
                    'Issue-Author' => issue.author.login
29 29
    redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
30 30
    recipients issue.recipients
31
    # ddumbugie
32
    from issue.author.mail if issue.author
31 33
    cc(issue.watcher_recipients - @recipients)
32 34
    subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
33 35
    body :issue => issue,
......
41 43
                    'Issue-Author' => issue.author.login
42 44
    redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
43 45
    recipients issue.recipients
46
    # ddumbugie
47
    from journal.user.mail if journal.user
44 48
    # Watchers in cc
45 49
    cc(issue.watcher_recipients - @recipients)
46 50
    s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
......
64 68
  def document_added(document)
65 69
    redmine_headers 'Project' => document.project.identifier
66 70
    recipients document.project.recipients
71
    # ddumbugie
72
    from document.attachments.first.author.mail if document.attachments.length > 1
67 73
    subject "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
74

  
75
#    added_to = ''
76
#    added_to_url = ''
77
#
78
#    if document.attachments
79
#      added_to_url = url_for(:controller => 'documents', :action => 'show', :id => document)
80
#      added_to = "#{l(:label_document)}: #{document.title}"
81
#    end
68 82
    body :document => document,
69 83
         :document_url => url_for(:controller => 'documents', :action => 'show', :id => document)
84
#,
85
#         :attachments => document.attachments,
86
#         :added_to => added_to,
87
#         :added_to_url => added_to_url
70 88
  end
71 89

  
72 90
  def attachments_added(attachments)
91
    # ddumbugie
92
    from attachments.first.author.mail if attachments.first.author
73 93
    container = attachments.first.container
74 94
    added_to = ''
75 95
    added_to_url = ''
......
93 113
  end
94 114

  
95 115
  def news_added(news)
116
    # ddumbugie
117
    from news.author.mail if news.author
96 118
    redmine_headers 'Project' => news.project.identifier
97 119
    recipients news.project.recipients
98 120
    subject "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
......
101 123
  end
102 124

  
103 125
  def message_posted(message, recipients)
126
    # ddumbugie
127
    from message.author.mail if message.author
104 128
    redmine_headers 'Project' => message.project.identifier,
105 129
                    'Topic-Id' => (message.parent_id || message.id)
106 130
    recipients(recipients)
(2-2/4)