Class: Feed2Email::Mail

Inherits:
Object
  • Object
show all
Defined in:
lib/feed2email/mail.rb

Instance Method Summary collapse

Constructor Details

#initialize(entry, feed_title) ⇒ Mail

Returns a new instance of Mail.



3
4
5
6
# File 'lib/feed2email/mail.rb', line 3

def initialize(entry, feed_title)
  @entry = entry
  @feed_title = feed_title
end

Instance Method Details

#sendObject



8
9
10
11
12
13
14
15
16
# File 'lib/feed2email/mail.rb', line 8

def send
  sleep config['send_delay'] || 10 # avoid Net::SMTPServerBusy errors

  if smtp_configured?
    send_with_smtp
  else
    send_with_sendmail
  end
end