class MailQueue::Consumer

Constants

QUEUES

Public Instance Methods

run() click to toggle source
# File lib/mail_queue.rb, line 11
def run
  config = self.config(:smtp)

  Mail.defaults do
    puts "~ Starting with #{config.inspect}."
    delivery_method :smtp, config
  end

  client.consumer('emails', 'emails.#') do |blob, header, frame|
    mail = Mail.new(blob)
    puts "~ Sending email to #{mail.to}"
    mail.deliver
  end
end