108868838-new_method_and_templates

This commit is contained in:
Stas 2015-12-01 15:01:35 +02:00
parent 8dd44c03d4
commit 58e35d5683
5 changed files with 158 additions and 0 deletions

View file

@ -176,6 +176,18 @@ class DomainMailer < ApplicationMailer
name: @domain.name)} [#{@domain.name}]")
end
def expiration_reminder(domain_id, should_deliver)
@domain = Domain.find_by(id: domain_id)
return unless @domain
return if delivery_off?(@domain, should_deliver)
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)