Sha256: e0851fd50195e898c8e04b19c303d83d8a8f28db90e96756c59ecf04536d77e4

Contents?: true

Size: 998 Bytes

Versions: 10

Compression:

Stored size: 998 Bytes

Contents

module ActionMailer
  class Base
    private
    def perform_delivery_cloudfuji(mail)
      if mail.to.nil?
        unless logger.nil?
          logger.error "This mail isn't addressed to anyone! Dropping"
        end

        return false
      end

      #result = Cloudfuji::App.mail_allowed?
      result = {"success" => true}

      if result
        logger.info result.inspect unless logger.nil?
        if result["success"] == true
          Cloudfuji::SMTP.setup_action_mailer_smtp!

          unless logger.nil?
            logger.info "App allowed to send email, sending via SMTP"
            logger.info "Sending:"
            logger.info mail.inspect
            __send__("perform_delivery_smtp", mail) if perform_deliveries
          end
        else
          logger.info "Unable to send email: #{result['message']}" unless logger.nil?
        end
      else
        logger.info "Unable to contact Cloudfuji to verify email credentials" unless logger.nil?
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cloudfuji-0.0.46 lib/cloudfuji/action_mailer.rb
cloudfuji-0.0.45 lib/cloudfuji/action_mailer.rb
cloudfuji-0.0.44 lib/cloudfuji/action_mailer.rb
cloudfuji-0.0.43 lib/cloudfuji/action_mailer.rb
cloudfuji-0.0.42 lib/cloudfuji/action_mailer.rb
cloudfuji-0.0.41 lib/cloudfuji/action_mailer.rb
cloudfuji-0.0.40 lib/cloudfuji/action_mailer.rb
cloudfuji-0.0.39 lib/cloudfuji/action_mailer.rb
cloudfuji-0.0.38 lib/cloudfuji/action_mailer.rb
cloudfuji-0.0.37 lib/cloudfuji/action_mailer.rb