mirror of
https://github.com/internetee/registry.git
synced 2025-07-29 22:16:19 +02:00
Created regex only email validation domain list
This commit is contained in:
parent
e17b21436d
commit
48726c3a9a
2 changed files with 5 additions and 0 deletions
|
@ -182,6 +182,8 @@ tara_rant_secret: 'secret'
|
|||
tara_rant_redirect_uri: 'redirect_uri'
|
||||
|
||||
default_email_validation_type: 'mx'
|
||||
# You can predefine regex only validation for domains (default value ''):
|
||||
regex_only_email_validations: 'somedomain.com, otherdomain.com'
|
||||
default_connection_timeout: '1'
|
||||
default_response_timeout: '1'
|
||||
|
||||
|
|
|
@ -48,6 +48,9 @@ Truemail.configure do |config|
|
|||
# And all of validations for 'otherdomain.com' will be processed with mx validation only.
|
||||
# It is equal to empty hash by default.
|
||||
# config.validation_type_for = { 'somedomain.com' => :regex, 'otherdomain.com' => :mx }
|
||||
config.validation_type_for = ENV['regex_only_email_validations'].split(/,/)
|
||||
.collect { |d| [d.strip, :regex] }
|
||||
.to_h
|
||||
|
||||
# Optional parameter. Validation of email which contains whitelisted domain always will
|
||||
# return true. Other validations will not processed even if it was defined in validation_type_for
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue