mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
Add forceDelete on email_verification failed
This commit is contained in:
parent
4522e4427e
commit
a8e3d67556
4 changed files with 14 additions and 7 deletions
|
@ -45,6 +45,6 @@ class BouncedMailAddress < ApplicationRecord
|
|||
end
|
||||
|
||||
def force_delete_from_bounce
|
||||
Domains::ForceDeleteBounce::Base.run(bounced_mail_address: self)
|
||||
Domains::ForceDeleteEmail::Base.run(email: email)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
class EmailAddressVerification < ApplicationRecord
|
||||
RECENTLY_VERIFIED_PERIOD = 1.month
|
||||
after_save :check_force_delete
|
||||
|
||||
scope :not_verified_recently, lambda {
|
||||
where('verified_at IS NULL or verified_at < ?', verification_period)
|
||||
|
@ -40,6 +41,12 @@ class EmailAddressVerification < ApplicationRecord
|
|||
success
|
||||
end
|
||||
|
||||
def check_force_delete
|
||||
return unless failed?
|
||||
|
||||
Domains::ForceDeleteEmail::Base.run(email: email)
|
||||
end
|
||||
|
||||
def verify
|
||||
validation_request = Truemail.validate(email)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue