Skip to content

v1.2.0

Compare
Choose a tag to compare
@bestwebua bestwebua released this 26 Jun 11:32
· 212 commits to master since this release
78abfbe

Implemented configurable option: validation for whitelisted domains only.

When email domain in whitelist and whitelist_validation is sets equal to true validation type will be passed to other validators. Validation of email which not contains whitelisted domain always will return false.

Truemail.configure do |config|
  config.verifier_email = '[email protected]'
  config.whitelisted_domains = ['white-domain.com']
  config.whitelist_validation = true
end

Email has whitelisted domain

Truemail.validate('[email protected]', with: :regex)

#<Truemail::Validator:0x000055b8429f3490
  @result=#<struct Truemail::Validator::Result
    success=true,
    email="[email protected]",
    domain=nil,
    mail_servers=[],
    errors={},
    smtp_debug=nil>,
  @validation_type=:regex>

Email hasn't whitelisted domain

Truemail.validate('[email protected]', with: :regex)

#<Truemail::Validator:0x000055b8429f3490
  @result=#<struct Truemail::Validator::Result
    success=false,
    email="[email protected]",
    domain=nil,
    mail_servers=[],
    errors={},
    smtp_debug=nil>,
  @validation_type=:blacklist>

  1. Added validation for whitelisted domains configurable option
  2. Updated tests
  3. Updated documentation
  4. Updated wiki
  5. Updated gem version to 1.2.0