mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 08:52:04 +02:00
Add registrar email validation
This commit is contained in:
parent
ba4e256662
commit
e56162f37d
3 changed files with 21 additions and 12 deletions
|
@ -28,7 +28,11 @@ Truemail.configure do |config|
|
|||
# Optional parameter. You can predefine default validation type for
|
||||
# Truemail.validate('email@email.com') call without with-parameter
|
||||
# Available validation types: :regex, :mx, :smtp
|
||||
config.default_validation_type = :smtp
|
||||
if Rails.env.production?
|
||||
config.default_validation_type = :smtp
|
||||
else
|
||||
config.default_validation_type = :regex
|
||||
end
|
||||
|
||||
# Optional parameter. You can predefine which type of validation will be used for domains.
|
||||
# Also you can skip validation by domain. Available validation types: :regex, :mx, :smtp
|
||||
|
@ -43,11 +47,6 @@ Truemail.configure do |config|
|
|||
# It is equal to empty array by default.
|
||||
# config.whitelisted_domains = []
|
||||
|
||||
unless Rails.env.production?
|
||||
config.whitelisted_domains = %w[bestnames.test goodnames.test example.com inbox.test mail.test
|
||||
outlook.test invalid.test email.test]
|
||||
end
|
||||
|
||||
# Optional parameter. With this option Truemail will validate email which contains whitelisted
|
||||
# domain only, i.e. if domain whitelisted, validation will passed to Regex, MX or SMTP validators.
|
||||
# Validation of email which not contains whitelisted domain always will return false.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue