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 = 0.5) ⇒ Sender
constructor
A new instance of Sender.
- #send(mailing) ⇒ Object
Constructor Details
#initialize(channel, envelope_from, logger = nil, delay = 0.5) ⇒ Sender
Returns a new instance of Sender.
5 6 7 8 9 10 |
# File 'lib/mailing/sender.rb', line 5 def initialize(channel, envelope_from, logger=nil, delay=0.5) @channel = channel @envelope_from = envelope_from @logger = logger @delay = delay end |
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
3 4 5 |
# File 'lib/mailing/sender.rb', line 3 def channel @channel end |
#delay ⇒ Object
Returns the value of attribute delay.
3 4 5 |
# File 'lib/mailing/sender.rb', line 3 def delay @delay end |
#envelope_from ⇒ Object
Returns the value of attribute envelope_from.
3 4 5 |
# File 'lib/mailing/sender.rb', line 3 def envelope_from @envelope_from end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/mailing/sender.rb', line 3 def logger @logger end |
Instance Method Details
#send(mailing) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/mailing/sender.rb', line 12 def send(mailing) @mailing = mailing @mail = @mailing.mail info "Start mailing: #{Time.now}" info @mail.encoded info "Recipients count: #{@mailing.recipients.size}" deliver end |