Sha256: e6417a34001a4e015e82a47d386800aae6fc3d82a03928a13af397f5fc4c4e15

Contents?: true

Size: 665 Bytes

Versions: 14

Compression:

Stored size: 665 Bytes

Contents

# frozen_string_literal: true

# TODO: Use deliver_later to avoid slowness and errors
class EmailNotify
  def self.logger
    @@logger ||= ::Rails.logger || Logger.new($stdout)
  end

  def self.send_comment(comment, user)
    return if user.email.blank?

    email = NotificationMailer.comment(comment, user)
    email.deliver_now
  end

  def self.send_article(article, user)
    return if user.email.blank?

    email = NotificationMailer.article(article, user)
    email.deliver_now
  end

  # Send a welcome mail to the user created
  def self.send_user_create_notification(user)
    email = NotificationMailer.notif_user(user)
    email.deliver_now
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
publify_core-10.0.2 lib/email_notify.rb
publify_core-10.0.1 lib/email_notify.rb
publify_core-10.0.0 lib/email_notify.rb
publify_core-9.2.10 lib/email_notify.rb
publify_core-9.2.9 lib/email_notify.rb
publify_core-9.2.8 lib/email_notify.rb
publify_core-9.2.7 lib/email_notify.rb
publify_core-9.2.6 lib/email_notify.rb
publify_core-9.2.5 lib/email_notify.rb
publify_core-9.2.4 lib/email_notify.rb
publify_core-9.2.3 lib/email_notify.rb
publify_core-9.2.2 lib/email_notify.rb
publify_core-9.2.1 lib/email_notify.rb
publify_core-9.2.0 lib/email_notify.rb