diff options
Diffstat (limited to 'app/models/mailer.rb')
-rw-r--r-- | app/models/mailer.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 5f655db85..683045715 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -60,7 +60,7 @@ class Mailer < ActionMailer::Base @body['journal']= journal end - def document_add(document) + def document_added(document) set_language_if_valid(Setting.default_language) @recipients = document.project.users.collect { |u| u.mail if u.mail_notification }.compact @from = Setting.mail_from @@ -68,21 +68,18 @@ class Mailer < ActionMailer::Base @body['document'] = document end - def attachments_add(attachments) + def attachments_added(attachments) set_language_if_valid(Setting.default_language) container = attachments.first.container url = '' added_to = '' case container.class.name when 'Version' - url = url_for(:only_path => false, :host => Setting.host_name, :controller => 'projects', :action => 'list_files', :id => container.project_id) + url = {: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 = url_for(:only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => container.id) + url = {:only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => container.id} added_to = "#{l(:label_document)}: #{container.title}" - when 'Issue' - 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 @from = Setting.mail_from |