Sha256: 6b19223f72396dcab107b2694a92d9f13c540e1cdceb06b6f68270c8ee10d35b
Contents?: true
Size: 856 Bytes
Versions: 3
Compression:
Stored size: 856 Bytes
Contents
# frozen_string_literal: true module Thredded class EmailNotifier def human_name I18n.t('thredded.email_notifier.by_email') end def key 'email' end def new_post(post, users) PostMailer.post_notification(post.id, users.map(&:email)).deliver_now MembersMarkedNotified.new(post, users).run end def new_private_post(post, users) users = exclude_previously_notified(post, users) return unless users.present? PrivateTopicMailer .message_notification(post.postable.id, users.map(&:email)) .deliver_now MembersMarkedNotified.new(post, users).run end def exclude_previously_notified(post, users) emails_notified = post.post_notifications.map(&:email) users.reject do |user| emails_notified.include? user.email end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
thredded-0.9.3 | app/notifiers/thredded/email_notifier.rb |
thredded-0.9.2 | app/notifiers/thredded/email_notifier.rb |
thredded-0.9.1 | app/notifiers/thredded/email_notifier.rb |