Truemail v1.2.0 Release Notes

Release Date: 2019-06-26 // over 3 years ago
  • โž• Added

    • ๐Ÿ”ง 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>
    

    ๐Ÿ”„ Changed

    • Truemail::VERSION
    • ๐Ÿ“š gem documentation