mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 07:04:47 +02:00
Return truemail
This reverts commit 862f5639ebbe4d3e6abd5d5be7fb7840e7b83bdf.
This commit is contained in:
parent
0a7b754c4c
commit
e4a02c2e47
35 changed files with 728 additions and 153 deletions
23
lib/tasks/verify_email.rake
Normal file
23
lib/tasks/verify_email.rake
Normal file
|
@ -0,0 +1,23 @@
|
|||
namespace :verify_email do
|
||||
desc 'Stars verifying email jobs for all the domain'
|
||||
task all_domains: :environment do
|
||||
verifications_by_domain = EmailAddressVerification.not_verified_recently.group_by(&:domain)
|
||||
verifications_by_domain.each do |_domain, verifications|
|
||||
ver = verifications.sample # Verify random email to not to clog the SMTP servers
|
||||
VerifyEmailsJob.enqueue(ver.id)
|
||||
next
|
||||
end
|
||||
end
|
||||
|
||||
# Need to be run like 'bundle exec rake verify_email:domain['gmail.com']'
|
||||
# In zsh syntax will be 'bundle exec rake verify_email:domain\['gmail.com'\]'
|
||||
# Default 'bundle exec rake verify_email:domain' wil use 'internet.ee' domain
|
||||
desc 'Stars verifying email jobs for domain stated in argument'
|
||||
task :domain, [:domain_name] => [:environment] do |_task, args|
|
||||
args.with_defaults(domain_name: 'internet.ee')
|
||||
|
||||
verifications_by_domain = EmailAddressVerification.not_verified_recently
|
||||
.by_domain(args[:domain_name])
|
||||
verifications_by_domain.map { |ver| VerifyEmailsJob.enqueue(ver.id) }
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue