Sha256: afaed683e8a6353ec9154abde00b139c8581cdd76e8feea542829f578ad64c1c

Contents?: true

Size: 516 Bytes

Versions: 1

Compression:

Stored size: 516 Bytes

Contents

module Georgia
  module Mailer
    class EmailDeliveryWorker
      include SuckerPunch::Job

      def perform(message_id)
        ActiveRecord::Base.connection_pool.with_connection do
          message = Message.find(message_id)
          unless message.spam or !Georgia::Mailer.turn_on_email_notifications
            Notifier.new_message_notification(message).deliver_now
          end
        end
      end

      def later(sec, message_id)
        after(sec) { perform(message_id) }
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
georgia_mailer-0.8.0 app/workers/georgia/mailer/email_delivery_worker.rb