mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 09:46:09 +02:00
parent
39d7c6ad1d
commit
ad0220088a
30 changed files with 697 additions and 59 deletions
|
@ -117,17 +117,6 @@ class DomainMailer < ApplicationMailer
|
|||
name: @domain.name)} [#{@domain.name}]")
|
||||
end
|
||||
|
||||
def expiration_reminder(domain_id)
|
||||
@domain = Domain.find_by(id: domain_id)
|
||||
return if @domain.nil? || !@domain.statuses.include?(DomainStatus::EXPIRED) || whitelist_blocked?(@domain.registrant.email)
|
||||
return if whitelist_blocked?(@domain.registrant.email)
|
||||
|
||||
mail(to: format(@domain.registrant.email),
|
||||
subject: "#{I18n.t(:expiration_remind_subject,
|
||||
name: @domain.name)} [#{@domain.name}]")
|
||||
end
|
||||
|
||||
|
||||
def force_delete(domain_id, should_deliver)
|
||||
@domain = Domain.find_by(id: domain_id)
|
||||
return if delivery_off?(@domain, should_deliver)
|
||||
|
@ -140,6 +129,16 @@ class DomainMailer < ApplicationMailer
|
|||
)
|
||||
end
|
||||
|
||||
def expiration(domain:)
|
||||
@domain = DomainPresenter.new(domain: domain, view: view_context)
|
||||
@registrar = RegistrarPresenter.new(registrar: domain.registrar, view: view_context)
|
||||
|
||||
recipients = domain.admin_contact_emails << domain.registrant_email
|
||||
|
||||
subject = default_i18n_subject(domain_name: domain.name)
|
||||
mail(to: recipients, subject: subject)
|
||||
end
|
||||
|
||||
private
|
||||
# app/models/DomainMailModel provides the data for mail that can be composed_from
|
||||
# which ensures that values of objects are captured when they are valid, not later when this method is executed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue