Class: Notification
- Inherits:
-
ActionMailer::Base
- Object
- ActionMailer::Base
- Notification
- Defined in:
- app/mailers/notification.rb
Instance Method Summary collapse
- #event(event, sid) ⇒ Object
- #forgotten_password(to_user_id) ⇒ Object
- #form_submission(submission_id, sid, recipient) ⇒ Object
- #moderation_required(object_type, message, sid) ⇒ Object
- #new_post(post, to_user) ⇒ Object
- #report_post_admin(report, sid) ⇒ Object
- #send_message(user_note, sid) ⇒ Object
- #welcome_message(to, sid) ⇒ Object
Instance Method Details
#event(event, sid) ⇒ Object
38 39 40 41 |
# File 'app/mailers/notification.rb', line 38 def event(event, sid) @e = event mail :from=>isfrom(sid),:subject=>"Event #{event.id} occurred: #{event.name}", :to => Preference.getCached(sid, 'notify:event') end |
#forgotten_password(to_user_id) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'app/mailers/notification.rb', line 23 def forgotten_password(to_user_id) @user = User.find(to_user_id) reset_url = Preference.get_cached(@user.system_id, "account_reset_url") || "/users/reset" @reset_link = Preference.get_cached(@user.system_id, "host") + reset_url + "/" + @user.reset_password_token mail :subject=>t("account.forgotten_password_subject"), :to=>@user.email, :from=>isfrom(@user.system_id) end |
#form_submission(submission_id, sid, recipient) ⇒ Object
43 44 45 46 47 48 |
# File 'app/mailers/notification.rb', line 43 def form_submission(submission_id,sid, recipient) @sub = FormSubmission.find(submission_id) @sid = sid mail :subject=>"#{Preference.getCached(sid,'app_name')} #{@sub.form.title} Submission", :to=>recipient, :from=>isfrom(sid) end |
#moderation_required(object_type, message, sid) ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'app/mailers/notification.rb', line 50 def moderation_required(object_type, ,sid) type = object_type.urlise @message = @type = object_type notify = Preference.get_cached(sid,"notify_#{type}") || Preference.get_cached(sid,"notify") mail :subject=>"#{type} Requires Moderation", :to=>notify, :from=>isfrom(sid) end |
#new_post(post, to_user) ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/mailers/notification.rb', line 15 def new_post(post, to_user) @sid = post.system_id @post = post @to_user = to_user mail :subject=>"#{Preference.get_cached(@sid, "site_name")}: New post on thread '#{truncate(post.topic_thread.title, :length=>80, :ommission=>'...')}'", :to=>@to_user.email, :from=>isfrom(@sid) end |
#report_post_admin(report, sid) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'app/mailers/notification.rb', line 6 def report_post_admin(report,sid) @post = report.topic_post @email = report.user.email @user = report.user.display_name @sid = sid mail(:from=>isfrom(sid), :to => Preference.getCached(sid, "report_post_notification"), :subject => "Reported Post") end |
#send_message(user_note, sid) ⇒ Object
59 60 61 62 63 |
# File 'app/mailers/notification.rb', line 59 def (user_note, sid) @user_note = user_note @sid = sid mail :from=>isfrom(sid), :to=>user_note.user.email, :subject=>user_note.subject end |
#welcome_message(to, sid) ⇒ Object
33 34 35 36 |
# File 'app/mailers/notification.rb', line 33 def (to, sid) @sid = sid mail(:from=>isfrom(sid), :to=>to.email, :subject=>"Thanks for joining") end |