Sha256: 8e6fec19488d80c964ec18248703424431fbec9126b30d3b6a47a6945d8ae2ec
Contents?: true
Size: 1.18 KB
Versions: 21
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true require "ostruct" module NeetoCommonsBackend module Initializers class << self def neeto_mail_interceptor intercept_secrets = Rails.application.secrets.mail_interceptor if Rails.env.staging? cleanup = proc { |n| n.split(",").map(&:strip) } interceptor = NeetoMailInterceptor::Interceptor.new( forward_emails_to: cleanup.call(intercept_secrets[:forward_emails_to] || ""), deliver_emails_to: cleanup.call(intercept_secrets[:whitelisted_emails] || "") ) ActionMailer::Base.register_interceptor(interceptor) elsif Rails.env.production? interceptor = NeetoMailInterceptor::Interceptor.new( env: OpenStruct.new(name: Rails.env, intercept?: true), only_intercept: ["@example.com", "@example.net", "@neetoauth.com", "nitrohelp.com"] ) ActionMailer::Base.register_interceptor(interceptor) end if Rails.application.secrets.zerobounce_api_key.present? NeetoMailInterceptor.configure do |config| config.enable_zerobounce_validation = true end end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems