Class: MailRoom::Delivery::Que

Inherits:
Object
  • Object
show all
Defined in:
lib/mail_room/delivery/que.rb

Overview

Que Delivery method

Author:

  • Tony Pitale

Defined Under Namespace

Classes: Options

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Que

Build a new delivery, hold the mailbox configuration


30
31
32
# File 'lib/mail_room/delivery/que.rb', line 30

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options


26
27
28
# File 'lib/mail_room/delivery/que.rb', line 26

def options
  @options
end

Instance Method Details

#deliver(message) ⇒ Object

deliver the message by pushing it onto the configured Sidekiq queue

Parameters:

  • message (String)

    the email message as a string, RFC822 format


36
37
38
39
# File 'lib/mail_room/delivery/que.rb', line 36

def deliver(message)
  queue_job(message)
  @options.logger.info({ delivery_method: 'Que', action: 'message pushed' })
end