Commit db4781d0 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Replaced hard-coded urls in Mailer#attachments_add

git-svn-id: http://redmine.rubyforge.org/svn/trunk@664 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 4fa51992
......@@ -69,17 +69,17 @@ class Mailer < ActionMailer::Base
def attachments_add(attachments)
set_language_if_valid(Setting.default_language)
container = attachments.first.container
url = "http://#{Setting.host_name}/"
added_to = ""
case container.class.to_s
url = ''
added_to = ''
case container.class.name
when 'Version'
url << "projects/list_files/#{container.project_id}"
url = url_for(:only_path => false, :host => Setting.host_name, :controller => 'projects', :action => 'list_files', :id => container.project_id)
added_to = "#{l(:label_version)}: #{container.name}"
when 'Document'
url << "documents/show/#{container.id}"
url = url_for(:only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => container.id)
added_to = "#{l(:label_document)}: #{container.title}"
when 'Issue'
url << "issues/show/#{container.id}"
url = url = url_for(:only_path => false, :host => Setting.host_name, :controller => 'issues', :action => 'show', :id => container.id)
added_to = "#{container.tracker.name} ##{container.id}: #{container.subject}"
end
@recipients = container.project.users.collect { |u| u.mail if u.mail_notification }.compact
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment