##// END OF EJS Templates
Replaced hard-coded urls in Mailer#attachments_add...
Jean-Philippe Lang -
r658:db4781d06860
parent child
Show More
@@ -69,17 +69,17 class Mailer < ActionMailer::Base
69 def attachments_add(attachments)
69 def attachments_add(attachments)
70 set_language_if_valid(Setting.default_language)
70 set_language_if_valid(Setting.default_language)
71 container = attachments.first.container
71 container = attachments.first.container
72 url = "http://#{Setting.host_name}/"
72 url = ''
73 added_to = ""
73 added_to = ''
74 case container.class.to_s
74 case container.class.name
75 when 'Version'
75 when 'Version'
76 url << "projects/list_files/#{container.project_id}"
76 url = url_for(:only_path => false, :host => Setting.host_name, :controller => 'projects', :action => 'list_files', :id => container.project_id)
77 added_to = "#{l(:label_version)}: #{container.name}"
77 added_to = "#{l(:label_version)}: #{container.name}"
78 when 'Document'
78 when 'Document'
79 url << "documents/show/#{container.id}"
79 url = url_for(:only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => container.id)
80 added_to = "#{l(:label_document)}: #{container.title}"
80 added_to = "#{l(:label_document)}: #{container.title}"
81 when 'Issue'
81 when 'Issue'
82 url << "issues/show/#{container.id}"
82 url = url = url_for(:only_path => false, :host => Setting.host_name, :controller => 'issues', :action => 'show', :id => container.id)
83 added_to = "#{container.tracker.name} ##{container.id}: #{container.subject}"
83 added_to = "#{container.tracker.name} ##{container.id}: #{container.subject}"
84 end
84 end
85 @recipients = container.project.users.collect { |u| u.mail if u.mail_notification }.compact
85 @recipients = container.project.users.collect { |u| u.mail if u.mail_notification }.compact
General Comments 0
You need to be logged in to leave comments. Login now