lib/emaildirect/mailer.rb in emaildirect-1.3.0 vs lib/emaildirect/mailer.rb in emaildirect-1.3.1

- old
+ new

@@ -4,11 +4,11 @@ # Implements a Mailer class that can be used by Mail to send using the relay functionality class Mailer def initialize(values = {}) self.settings = { :category_id => nil, :options => {}, - :logger => defined?(Rails) && Rails.logger, + :logger => defined?(::Rails) && ::Rails.logger, :log_level => :debug }.merge!(values) raise ArgumentError, 'Category ID is required' unless settings[:category_id] end @@ -18,10 +18,9 @@ self end def deliver!(mail) destinations ||= mail.destinations if mail.respond_to?(:destinations) && mail.destinations - Mail::Message if destinations.blank? raise ArgumentError.new('At least one recipient (To, Cc or Bcc) is required to send a message') end options = request_data mail