mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 15:34:41 +02:00
Add default email validation type to application.yml
This commit is contained in:
parent
39a21cb790
commit
87fe230035
2 changed files with 7 additions and 1 deletions
|
@ -156,6 +156,9 @@ lhv_dev_mode: 'false'
|
|||
|
||||
epp_session_timeout_seconds: '300'
|
||||
|
||||
# Email validation setting for Truemail gem. Possible values: 'regex', 'mx', 'smtp'
|
||||
default_email_validation_type: 'regex'
|
||||
|
||||
# Since the keys for staging are absent from the repo, we need to supply them separate for testing.
|
||||
test:
|
||||
payments_seb_bank_certificate: 'test/fixtures/files/seb_bank_cert.pem'
|
||||
|
|
|
@ -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