diff options
-rw-r--r-- | app/controllers/admin_request_controller.rb | 3 | ||||
-rw-r--r-- | app/mailers/contact_mailer.rb | 8 | ||||
-rw-r--r-- | lib/tasks/translation.rake | 7 |
3 files changed, 10 insertions, 8 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index 4d45ced8b..ca4179acb 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_request_controller.rb @@ -281,7 +281,8 @@ class AdminRequestController < AdminController if ! info_request.is_external? ContactMailer.from_admin_message( - info_request.user, + info_request.user.name, + info_request.user.email, subject, params[:explanation].strip.html_safe ).deliver diff --git a/app/mailers/contact_mailer.rb b/app/mailers/contact_mailer.rb index 2952d6425..27e04ca4b 100644 --- a/app/mailers/contact_mailer.rb +++ b/app/mailers/contact_mailer.rb @@ -34,11 +34,11 @@ class ContactMailer < ApplicationMailer end # Send message to a user from the administrator - def from_admin_message(recipient_user, subject, message) - @message, @from_user, @recipient_user = message, contact_from_name_and_email, recipient_user - + def from_admin_message(recipient_name, recipient_email, subject, message) + @message, @from_user = message, contact_from_name_and_email + @recipient_name, @recipient_email = recipient_name, recipient_email mail(:from => contact_from_name_and_email, - :to => recipient_user.name_and_email, + :to => MailHandler.address_from_name_and_email(@recipient_name, @recipient_email), :bcc => AlaveteliConfiguration::contact_email, :subject => subject) end diff --git a/lib/tasks/translation.rake b/lib/tasks/translation.rake index 6458d9268..b1f9d0b71 100644 --- a/lib/tasks/translation.rake +++ b/lib/tasks/translation.rake @@ -66,9 +66,10 @@ namespace :translation do 'Hello!') write_email(user_contact_email, 'Contact email (user to user)', output_file) - admin_contact_email = ContactMailer.from_admin_message(info_request.user, - 'A test message', - 'Hello!') + admin_contact_email = ContactMailer.from_admin_message(info_request.user.name, + info_request.user.email, + 'A test message', + 'Hello!') write_email(admin_contact_email, 'Contact email (admin to user)', output_file) # request mailer |