Module: CommandTower::Messaging::ChannelDetectors

Defined in:
app/services/command_tower/messaging/channel_detectors.rb

Overview

Shared platform channel configuration detectors.

Answers transport/deployment readiness questions (is email/SMS/Pushover configured?). Does not own host channel-set policy (PlatformEnabledChannels), recipient readiness, or Account UX capability projection.

SMS product readiness (Messaging notification SMS ∧ Identity OTP SMS) is exposed separately from sms_configured? so Planner/Execution platform_configured stays Messaging-only while Me phone HTTP / host SMS policy use the dual-gate.

Class Method Summary collapse

Class Method Details

.configured?(channel_key) ⇒ Boolean

Used by RecipientReadiness#platform_configured_for? (fail-closed).

Returns:

  • (Boolean)


30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/services/command_tower/messaging/channel_detectors.rb', line 30

def configured?(channel_key)
  case channel_key.to_s
  when "inbox"
    true
  when "email"
    email_configured?
  when "sms"
    sms_configured?
  when "pushover"
    pushover_configured?
  else
    false
  end
end

.email_configured?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/services/command_tower/messaging/channel_detectors.rb', line 17

def email_configured?
  Execution::Adapters::Email::Configuration.email_configured?
end

.pushover_configured?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'app/services/command_tower/messaging/channel_detectors.rb', line 25

def pushover_configured?
  Execution::Adapters::Pushover::Configuration.pushover_configured?
end

.sms_configured?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/services/command_tower/messaging/channel_detectors.rb', line 21

def sms_configured?
  Execution::Adapters::Sms::Configuration.sms_configured?
end

.sms_product_ready?Boolean

Messaging notification SMS ∧ Identity OTP SMS.

Returns:

  • (Boolean)


46
47
48
49
# File 'app/services/command_tower/messaging/channel_detectors.rb', line 46

def sms_product_ready?
  sms_configured? &&
    CommandTower::Identity::PhoneVerification::SmsConfiguration.sms_ready?
end