Class: Thredded::EmailNotifier
- Inherits:
-
Object
- Object
- Thredded::EmailNotifier
- Defined in:
- app/notifiers/thredded/email_notifier.rb
Instance Method Summary collapse
- #human_name ⇒ Object
-
#initialize ⇒ EmailNotifier
constructor
A new instance of EmailNotifier.
- #key ⇒ Object
- #new_post(post, users) ⇒ Object
- #new_private_post(post, users) ⇒ Object
Constructor Details
#initialize ⇒ EmailNotifier
Returns a new instance of EmailNotifier.
5 6 7 |
# File 'app/notifiers/thredded/email_notifier.rb', line 5 def initialize fail 'Please set Thredded.email_from in config/initializers/thredded.rb' if Thredded.email_from.blank? end |
Instance Method Details
#human_name ⇒ Object
9 10 11 |
# File 'app/notifiers/thredded/email_notifier.rb', line 9 def human_name I18n.t('thredded.email_notifier.by_email') end |
#key ⇒ Object
13 14 15 |
# File 'app/notifiers/thredded/email_notifier.rb', line 13 def key 'email' end |
#new_post(post, users) ⇒ Object
17 18 19 |
# File 'app/notifiers/thredded/email_notifier.rb', line 17 def new_post(post, users) Thredded::PostMailer.post_notification(post.id, users.map(&:email)).deliver_now end |
#new_private_post(post, users) ⇒ Object
21 22 23 |
# File 'app/notifiers/thredded/email_notifier.rb', line 21 def new_private_post(post, users) Thredded::PrivateTopicMailer.(post.id, users.map(&:email)).deliver_now end |