mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
Add email verification rake task
This commit is contained in:
parent
ee7d69c1ce
commit
a13725faa7
3 changed files with 35 additions and 7 deletions
11
lib/tasks/verify_email.rake
Normal file
11
lib/tasks/verify_email.rake
Normal file
|
@ -0,0 +1,11 @@
|
|||
namespace :verify_email do
|
||||
desc 'Stars verifying email jobs'
|
||||
task all_domains: :environment do
|
||||
verifications_by_domain = EmailAddressVerification.not_verified_recently.group_by(&:domain)
|
||||
|
||||
verifications_by_domain.each do |_domain, verifications|
|
||||
ver = verifications[0] # Only first email to not to clog the SMTP servers
|
||||
VerifyEmailsJob.enqueue(ver.id)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue