diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-05-25 13:10:40 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-05-25 13:10:40 +0100 |
commit | af2d6d28571bb49d25b7982d1ba508b850a05b0f (patch) | |
tree | 8307be70f1dc02d6bd3cf4e005ff6d12b71166bc | |
parent | 1367bf94eb1f6bfcf96f873b0c395326ac61670c (diff) |
A new method for ContactMailer that sends messages to users from admins
-rw-r--r-- | app/models/contact_mailer.rb | 12 | ||||
-rw-r--r-- | app/views/contact_mailer/from_admin_message.rhtml | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/app/models/contact_mailer.rb b/app/models/contact_mailer.rb index 74c213c7a..800fe54e4 100644 --- a/app/models/contact_mailer.rb +++ b/app/models/contact_mailer.rb @@ -42,4 +42,16 @@ class ContactMailer < ApplicationMailer } end + # Send message to a user from the administrator + def from_admin_message(recipient_user, subject, message) + @from = contact_from_name_and_email + @recipients = recipient_user.name_and_email + @subject = subject + @body = { + :message => message, + :from_user => @from, + :recipient_user => recipient_user, + } + end + end diff --git a/app/views/contact_mailer/from_admin_message.rhtml b/app/views/contact_mailer/from_admin_message.rhtml new file mode 100644 index 000000000..bdb48d580 --- /dev/null +++ b/app/views/contact_mailer/from_admin_message.rhtml @@ -0,0 +1,2 @@ +<%= @message.strip %> + |