mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
Merge pull request #1730 from internetee/442-forcedelete-notification-template-selection
Auto-select email template
This commit is contained in:
commit
b3c5aa2d41
5 changed files with 29 additions and 9 deletions
|
@ -22,7 +22,7 @@ module Admin
|
|||
send_email
|
||||
domain.update(contact_notification_sent_date: Time.zone.today)
|
||||
else
|
||||
domain.update(template_name: params[:template_name])
|
||||
domain.update(template_name: domain.notification_template)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -46,7 +46,7 @@ module Admin
|
|||
DomainDeleteMailer.forced(domain: domain,
|
||||
registrar: domain.registrar,
|
||||
registrant: domain.registrant,
|
||||
template_name: params[:template_name]).deliver_now
|
||||
template_name: domain.notification_template).deliver_now
|
||||
end
|
||||
|
||||
def force_delete_type
|
||||
|
|
|
@ -19,6 +19,10 @@ module Concerns::Domain::ForceDelete # rubocop:disable Metrics/ModuleLength
|
|||
end
|
||||
end
|
||||
|
||||
def notification_template
|
||||
registrant.org? ? 'legal_person' : 'private_person'
|
||||
end
|
||||
|
||||
def force_delete_scheduled?
|
||||
statuses.include?(DomainStatus::FORCE_DELETE)
|
||||
end
|
||||
|
|
|
@ -33,12 +33,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group email-template-row">
|
||||
<label class="col-md-3 control-label"><%= t '.email_template' %></label>
|
||||
<div class="col-md-9">
|
||||
<%= select_tag 'template_name', options_for_select(templates), class: 'form-control' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="modal-footer">
|
||||
|
|
|
@ -32,4 +32,4 @@
|
|||
</div>
|
||||
|
||||
<%= render 'form' %>
|
||||
<%= render 'force_delete_dialog', domain: @domain, templates: force_delete_templates %>
|
||||
<%= render 'force_delete_dialog', domain: @domain %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue