mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 10:16:01 +02:00
Merge pull request #1675 from internetee/external-mail-validation-settings
Add default email validation type to application.yml
This commit is contained in:
commit
039ed3798f
2 changed files with 7 additions and 1 deletions
|
@ -28,7 +28,10 @@ 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
|
||||
if Rails.env.production?
|
||||
if ENV['default_email_validation_type'].present? &&
|
||||
%w[regex, mx, smtp].include?(ENV['default_email_validation_type'])
|
||||
config.default_validation_type = ENV['default_email_validation_type'].to_sym
|
||||
elsif Rails.env.production?
|
||||
config.default_validation_type = :mx
|
||||
else
|
||||
config.default_validation_type = :regex
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue