diff --git a/app/views/sms_settings/index.html.erb b/app/views/sms_settings/index.html.erb
index 72fecae2..055b1fa6 100644
--- a/app/views/sms_settings/index.html.erb
+++ b/app/views/sms_settings/index.html.erb
@@ -4,6 +4,7 @@
SMS
<% value = @encrypted_config.value || {} %>
+ <% sms_enabled = Sms.enabled?(current_account) %>
<% sms_live = Sms.enabled_for?(current_account) %>
<%
provider_labels = {
@@ -32,6 +33,16 @@
+ <% elsif sms_enabled %>
+
+ <%= svg_icon('discount_check_filled', class: 'w-6 h-6') %>
+
+
SMS is enabled but not fully configured
+
+ Select a provider below and fill in its credentials, then save.
+
+
+
<% else %>
<%= svg_icon('info_circle', class: 'w-6 h-6') %>
@@ -187,16 +198,25 @@
diff --git a/lib/sms.rb b/lib/sms.rb
index 9a9fe1c7..67a70f11 100644
--- a/lib/sms.rb
+++ b/lib/sms.rb
@@ -20,6 +20,11 @@ module Sms
record&.value
end
+ def enabled?(account)
+ config = configuration_for(account)
+ config.is_a?(Hash) && !!config['enabled']
+ end
+
def enabled_for?(account)
config = configuration_for(account)
return false unless config.is_a?(Hash)