Class: Mailing::Sender
- Inherits:
-
Object
- Object
- Mailing::Sender
- Defined in:
- lib/mailing/sender.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#delay ⇒ Object
Returns the value of attribute delay.
-
#envelope_from ⇒ Object
Returns the value of attribute envelope_from.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(channel, envelope_from, logger = nil, delay = DELAY) ⇒ Sender
constructor
A new instance of Sender.
- #send(mailing) ⇒ Object
Constructor Details
#initialize(channel, envelope_from, logger = nil, delay = DELAY) ⇒ Sender
Returns a new instance of Sender.
7 8 9 10 11 12 |
# File 'lib/mailing/sender.rb', line 7 def initialize(channel, envelope_from, logger=nil, delay=DELAY) @channel = channel @envelope_from = envelope_from @logger = logger @delay = delay end |
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
5 6 7 |
# File 'lib/mailing/sender.rb', line 5 def channel @channel end |
#delay ⇒ Object
Returns the value of attribute delay.
5 6 7 |
# File 'lib/mailing/sender.rb', line 5 def delay @delay end |
#envelope_from ⇒ Object
Returns the value of attribute envelope_from.
5 6 7 |
# File 'lib/mailing/sender.rb', line 5 def envelope_from @envelope_from end |
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/mailing/sender.rb', line 5 def logger @logger end |
Instance Method Details
#send(mailing) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/mailing/sender.rb', line 14 def send(mailing) @mailing = mailing @mail = @mailing.mail info "Start mailing: #{Time.now}" info @mail.encoded info "Recipients count: #{@mailing.recipients.size}" deliver end |