aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-05-25 13:10:40 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-05-25 13:10:40 +0100
commitaf2d6d28571bb49d25b7982d1ba508b850a05b0f (patch)
tree8307be70f1dc02d6bd3cf4e005ff6d12b71166bc
parent1367bf94eb1f6bfcf96f873b0c395326ac61670c (diff)
A new method for ContactMailer that sends messages to users from admins
-rw-r--r--app/models/contact_mailer.rb12
-rw-r--r--app/views/contact_mailer/from_admin_message.rhtml2
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 %>
+