mirror of
https://github.com/internetee/registry.git
synced 2025-06-13 08:04:45 +02:00
Merge pull request #1152 from internetee/remove-legacy-test-emails
Remove legacy test emails
This commit is contained in:
commit
0a612c244a
6 changed files with 0 additions and 39 deletions
|
@ -3,19 +3,6 @@ class ApplicationMailer < ActionMailer::Base
|
||||||
default from: 'noreply@internet.ee'
|
default from: 'noreply@internet.ee'
|
||||||
layout 'mailer'
|
layout 'mailer'
|
||||||
|
|
||||||
def whitelist_blocked?(emails)
|
|
||||||
return false if Rails.env.production? || Rails.env.test?
|
|
||||||
|
|
||||||
emails = [emails] unless emails.is_a?(Array)
|
|
||||||
emails = emails.flatten
|
|
||||||
emails.each do |email|
|
|
||||||
next if TEST_EMAILS.include?(email)
|
|
||||||
logger.info "EMAIL SENDING WAS BLOCKED BY WHITELIST: #{email}"
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
false
|
|
||||||
end
|
|
||||||
|
|
||||||
# turn on delivery on specific (epp) request only, thus rake tasks does not deliver anything
|
# turn on delivery on specific (epp) request only, thus rake tasks does not deliver anything
|
||||||
def delivery_off?(model, deliver_emails = false)
|
def delivery_off?(model, deliver_emails = false)
|
||||||
return false if deliver_emails == true
|
return false if deliver_emails == true
|
||||||
|
|
|
@ -13,7 +13,6 @@ class ContactMailer < ApplicationMailer
|
||||||
|
|
||||||
return unless email || @contact
|
return unless email || @contact
|
||||||
return if delivery_off?(@contact, should_deliver)
|
return if delivery_off?(@contact, should_deliver)
|
||||||
return if whitelist_blocked?(email)
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
mail(to: format(email), subject: "#{I18n.t(:contact_email_update_subject)} [#{@contact.code}]")
|
mail(to: format(email), subject: "#{I18n.t(:contact_email_update_subject)} [#{@contact.code}]")
|
||||||
|
|
|
@ -17,7 +17,6 @@ class DomainMailer < ApplicationMailer
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
return if whitelist_blocked?(@domain.registrant.email)
|
|
||||||
mail(to: format(@domain.registrant.email),
|
mail(to: format(@domain.registrant.email),
|
||||||
subject: "#{I18n.t(:pending_delete_rejected_notification_subject,
|
subject: "#{I18n.t(:pending_delete_rejected_notification_subject,
|
||||||
name: @domain.name)} [#{@domain.name}]")
|
name: @domain.name)} [#{@domain.name}]")
|
||||||
|
@ -29,7 +28,6 @@ class DomainMailer < ApplicationMailer
|
||||||
return if delivery_off?(@domain, should_deliver)
|
return if delivery_off?(@domain, should_deliver)
|
||||||
# no delivery off control, driggered by cron, no epp request
|
# no delivery off control, driggered by cron, no epp request
|
||||||
|
|
||||||
return if whitelist_blocked?(@domain.registrant.email)
|
|
||||||
mail(to: format(@domain.registrant.email),
|
mail(to: format(@domain.registrant.email),
|
||||||
subject: "#{I18n.t(:pending_delete_expired_notification_subject,
|
subject: "#{I18n.t(:pending_delete_expired_notification_subject,
|
||||||
name: @domain.name)} [#{@domain.name}]")
|
name: @domain.name)} [#{@domain.name}]")
|
||||||
|
@ -40,7 +38,6 @@ class DomainMailer < ApplicationMailer
|
||||||
return unless @domain
|
return unless @domain
|
||||||
return if delivery_off?(@domain, should_deliver)
|
return if delivery_off?(@domain, should_deliver)
|
||||||
|
|
||||||
return if whitelist_blocked?(@domain.registrant.email)
|
|
||||||
mail(to: format(@domain.registrant.email),
|
mail(to: format(@domain.registrant.email),
|
||||||
subject: "#{I18n.t(:delete_confirmation_subject,
|
subject: "#{I18n.t(:delete_confirmation_subject,
|
||||||
name: @domain.name)} [#{@domain.name}]")
|
name: @domain.name)} [#{@domain.name}]")
|
||||||
|
|
|
@ -5,7 +5,6 @@ class InvoiceMailer < ApplicationMailer
|
||||||
@invoice = Invoice.find_by(id: invoice_id)
|
@invoice = Invoice.find_by(id: invoice_id)
|
||||||
billing_email ||= @invoice.billing_email
|
billing_email ||= @invoice.billing_email
|
||||||
return unless @invoice
|
return unless @invoice
|
||||||
return if whitelist_blocked?(billing_email)
|
|
||||||
|
|
||||||
kit = PDFKit.new(html)
|
kit = PDFKit.new(html)
|
||||||
pdf = kit.to_pdf
|
pdf = kit.to_pdf
|
||||||
|
|
|
@ -22,13 +22,6 @@ smtp_enable_starttls_auto: 'true' # 'false'
|
||||||
# If your mail server requires authentication, please change.
|
# If your mail server requires authentication, please change.
|
||||||
smtp_authentication: 'plain' # 'plain', 'login', 'cram_md5'
|
smtp_authentication: 'plain' # 'plain', 'login', 'cram_md5'
|
||||||
registrant_url: 'https://registrant.example.com' # for valid email body registrant links
|
registrant_url: 'https://registrant.example.com' # for valid email body registrant links
|
||||||
# Staging env does not send any emails unless they are whitelisted
|
|
||||||
whitelist_emails_for_staging: >
|
|
||||||
test@example.org,
|
|
||||||
old@example.org,
|
|
||||||
new@example.org,
|
|
||||||
old@example.com,
|
|
||||||
new@example.com
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# ADMIN server
|
# ADMIN server
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
TEST_EMAILS =
|
|
||||||
if Rails.env.test?
|
|
||||||
%w(
|
|
||||||
test@example.com
|
|
||||||
test@example.org
|
|
||||||
old@example.org
|
|
||||||
new@example.org
|
|
||||||
old@example.com
|
|
||||||
new@example.com
|
|
||||||
)
|
|
||||||
else
|
|
||||||
ENV['whitelist_emails_for_staging'] ||= ''
|
|
||||||
ENV['whitelist_emails_for_staging'].to_s.split(',').map(&:strip)
|
|
||||||
end
|
|
Loading…
Add table
Add a link
Reference in a new issue