Sha256: ee3562ea7d1977f3ab0e0f3861dd6b0c8f846135bc04d7fa1fd6c33d47f2b9cd

Contents?: true

Size: 740 Bytes

Versions: 17

Compression:

Stored size: 740 Bytes

Contents

module Mail
  module CheckDeliveryParams
    def check_delivery_params(mail)
      if mail.smtp_envelope_from.blank?
        raise ArgumentError.new('An SMTP From address is required to send a message. Set the message smtp_envelope_from, return_path, sender, or from address.')
      end

      if mail.smtp_envelope_to.blank?
        raise ArgumentError.new('An SMTP To address is required to send a message. Set the message smtp_envelope_to, to, cc, or bcc address.')
      end

      message = mail.encoded if mail.respond_to?(:encoded)
      if message.blank?
        raise ArgumentError.new('An encoded message is required to send an email')
      end

      [mail.smtp_envelope_from, mail.smtp_envelope_to, message]
    end
  end
end

Version data entries

17 entries across 16 versions & 9 rubygems

Version Path
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/check_delivery_params.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/check_delivery_params.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/mail-2.6.3/lib/mail/check_delivery_params.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/mail-2.6.3/lib/mail/check_delivery_params.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/check_delivery_params.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/mail-2.6.3/lib/mail/check_delivery_params.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/mail-2.6.3/lib/mail/check_delivery_params.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/mail-2.6.3/lib/mail/check_delivery_params.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/mail-2.6.3/lib/mail/check_delivery_params.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/mail-2.6.3/lib/mail/check_delivery_params.rb
mail-2.6.3 lib/mail/check_delivery_params.rb
mail-portertech-2.6.2.edge lib/mail/check_delivery_params.rb
mail-2.6.1 lib/mail/check_delivery_params.rb
mail-2.6.0 lib/mail/check_delivery_params.rb
challah-1.0.0 vendor/bundle/gems/mail-2.5.4/lib/mail/check_delivery_params.rb
swipe-rails-0.0.5 vendor/bundle/gems/mail-2.5.4/lib/mail/check_delivery_params.rb
mail-2.5.4 lib/mail/check_delivery_params.rb