Allow skipping email notification on domain force delete

#727
This commit is contained in:
Artur Beljajev 2018-02-24 13:05:04 +02:00
parent a49b592fac
commit b5870d3eb5
4 changed files with 34 additions and 2 deletions

View file

@ -68,7 +68,7 @@ module Admin
@domain.transaction do
@domain.schedule_force_delete
@domain.registrar.messages.create!(body: I18n.t('force_delete_set_on_domain', domain_name: @domain.name))
DomainDeleteForcedEmailJob.enqueue(@domain.id, params[:template_name])
DomainDeleteForcedEmailJob.enqueue(@domain.id, params[:template_name]) if notify_by_email?
end
redirect_to edit_admin_domain_url(@domain), notice: t('.scheduled')
@ -132,5 +132,9 @@ module Admin
def force_delete_templates
%w(removed_company death)
end
def notify_by_email?
ActiveRecord::Type::Boolean.new.type_cast_from_user(params[:notify_by_email])
end
end
end