Skip to content

Commit

Permalink
validation when contact create
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Hasjanov authored and Oleg Hasjanov committed Feb 12, 2024
1 parent 20cbdbf commit 681092b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/interactions/actions/contact_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def call
validate_ident
maybe_change_email
commit
validate_contact
end

def maybe_change_email
Expand Down Expand Up @@ -88,5 +89,11 @@ def commit
contact.email_history = contact.email
contact.save
end

def validate_contact
[:regex, :mx].each do |m|
contact.verify_email(check_level: m, single_email: true)
end
end
end
end

0 comments on commit 681092b

Please sign in to comment.