class Rad::Mailer inject logger: :logger def deliver letter mail = Mail.new letter.to_h if rad.development? logger.info "RAD delivering mail #{letter.to_h.inspect}" else logger.info "RAD delivering mail '#{letter.subject}'" end mail.deliver! end end