Mode DomainDeleteConfirm job to interactor

This commit is contained in:
Alex Sherman 2020-11-23 16:31:26 +05:00
parent fce16f924d
commit a3e6bc4cf9
2 changed files with 23 additions and 17 deletions

View file

@ -0,0 +1,22 @@
module DomainDeleteConfirmInteraction
class SendRequest < ActiveInteraction::Base
object :domain,
class: Domain,
description: 'Domain to send delete confirmation'
def execute
log
DomainDeleteMailer.confirmation_request(domain: domain,
registrar: domain.registrar,
registrant: domain.registrant).deliver_now
end
private
def log
message = "Send DomainDeleteMailer#confirm email for domain #{domain.name} (##{domain.id})" \
" to #{domain.registrant.email}"
Rails.logger.info(message)
end
end
end