Module: Protege::EmailDomainsHelper

Included in:
ApplicationHelper
Defined in:
app/helpers/protege/email_domains_helper.rb

Overview

View helpers for email-domain pages and the domains sidebar.

Instance Method Summary collapse

Instance Method Details

#all_email_domainsActiveRecord::Relation<Protege::EmailDomain>

Fetch every EmailDomain ordered by name for sidebar listing.

Returns:



9
10
11
# File 'app/helpers/protege/email_domains_helper.rb', line 9

def all_email_domains
  EmailDomain.order(:domain)
end

#mail_self_hosted?Boolean

Whether Protege is running the self-hosted MTA (as opposed to an email provider). Keys off the existing accessory setting via Gateway.mail_accessory_host — no separate flag. Drives the mode-aware domain page: only self-hosting uses +EmailDomain+'s own DKIM key and can push to an MTA.

Returns:

  • (Boolean)

    true when a mail accessory is configured



18
19
20
# File 'app/helpers/protege/email_domains_helper.rb', line 18

def mail_self_hosted?
  Gateway.mail_accessory_host.present?
end