Handle invalid emails in DomainExpireMailer#expired, move logging from job to mailer

#186
This commit is contained in:
Artur Beljajev 2016-11-23 21:20:28 +02:00
parent a5c0333a5d
commit e6e3ab9e1e
4 changed files with 78 additions and 43 deletions

View file

@ -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