Class: Lipwig::Senders::SMTP
- Defined in:
- lib/lipwig/senders/smtp.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from Abstract
Constructor Details
This class inherits a constructor from Lipwig::Senders::Abstract
Instance Method Details
#call ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/lipwig/senders/smtp.rb', line 4 def call recipients.each do |recipient| mail = Mail.new mail.delivery_method delivery_method, mail.content_type = 'text/html; charset=UTF-8' mail.from = from mail.to = recipient mail.subject = email.subject mail.body = email.body mail.cc = email.ccs begin puts "Delivery To: #{Array(recipient).join(', ')}" mail.deliver! puts "Delivery Status: OK", "" rescue => error puts "Delivery Status: Failed (#{error.})", "" end end end |