mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
Handle invalid emails in DomainExpireMailer#expired, move logging from job to mailer
#186
This commit is contained in:
parent
a5c0333a5d
commit
e6e3ab9e1e
4 changed files with 78 additions and 43 deletions
|
@ -4,18 +4,6 @@ class DomainExpireEmailJob < Que::Job
|
|||
|
||||
return if domain.registered?
|
||||
|
||||
log(domain)
|
||||
DomainExpireMailer.expired(domain: domain, registrar: domain.registrar).deliver_now
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def log(domain)
|
||||
message = "Send DomainExpireMailer#expired email for domain ##{domain.id} to #{domain.primary_contact_emails.join(', ')}"
|
||||
logger.info(message)
|
||||
end
|
||||
|
||||
def logger
|
||||
Rails.logger
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue