Sha256: 23e8145b64aa901d9e28671a11e4f7a4d72a32ab33a187832c9bc22cdd368d30

Contents?: true

Size: 664 Bytes

Versions: 10

Compression:

Stored size: 664 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

10 entries across 10 versions & 1 rubygems

Version Path
HornsAndHooves-publify_core-10.5.0 lib/email_notify.rb
HornsAndHooves-publify_core-10.4.0 lib/email_notify.rb
HornsAndHooves-publify_core-10.3.0 lib/email_notify.rb
HornsAndHooves-publify_core-10.2.0 lib/email_notify.rb
HornsAndHooves-publify_core-10.1.1 lib/email_notify.rb
HornsAndHooves-publify_core-10.1.0 lib/email_notify.rb
HornsAndHooves-publify_core-10.0.3 lib/email_notify.rb
HornsAndHooves-publify_core-10.0.2 lib/email_notify.rb
HornsAndHooves-publify_core-10.0.1 lib/email_notify.rb
HornsAndHooves-publify_core-10.0.0 lib/email_notify.rb