Sha256: e6b3e3ef6a3a3b0de6519bb51d323845371a60b4e1c26708375eef71053492e7

Contents?: true

Size: 596 Bytes

Versions: 30

Compression:

Stored size: 596 Bytes

Contents

# frozen_string_literal: true

module Thredded
  class EmailNotifier
    def initialize
      fail 'Please set Thredded.email_from in config/initializers/thredded.rb' if Thredded.email_from.blank?
    end

    def human_name
      I18n.t('thredded.email_notifier.by_email')
    end

    def key
      'email'
    end

    def new_post(post, users)
      Thredded::PostMailer.post_notification(post.id, users.map(&:email)).deliver_now
    end

    def new_private_post(post, users)
      Thredded::PrivateTopicMailer.message_notification(post.id, users.map(&:email)).deliver_now
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
thredded-1.1.0 app/notifiers/thredded/email_notifier.rb
thredded-1.0.1 app/notifiers/thredded/email_notifier.rb
thredded-1.0.0 app/notifiers/thredded/email_notifier.rb
thredded-0.16.16 app/notifiers/thredded/email_notifier.rb
thredded-0.16.15 app/notifiers/thredded/email_notifier.rb
thredded-0.16.14 app/notifiers/thredded/email_notifier.rb
thredded-0.16.13 app/notifiers/thredded/email_notifier.rb
thredded-0.16.12 app/notifiers/thredded/email_notifier.rb
thredded-0.16.11 app/notifiers/thredded/email_notifier.rb
thredded-0.16.10 app/notifiers/thredded/email_notifier.rb
thredded-0.16.9 app/notifiers/thredded/email_notifier.rb
thredded-0.16.8 app/notifiers/thredded/email_notifier.rb
thredded-0.16.7 app/notifiers/thredded/email_notifier.rb
thredded-0.16.6 app/notifiers/thredded/email_notifier.rb
thredded-0.16.5 app/notifiers/thredded/email_notifier.rb
thredded-0.16.4 app/notifiers/thredded/email_notifier.rb
thredded-0.16.3 app/notifiers/thredded/email_notifier.rb
thredded-0.16.1 app/notifiers/thredded/email_notifier.rb
thredded-0.16.0 app/notifiers/thredded/email_notifier.rb
thredded-0.15.5 app/notifiers/thredded/email_notifier.rb