From 68579f796998ca2c9e05bc6dce4361d2d4a3496e Mon Sep 17 00:00:00 2001 From: Phillip Davis Date: Fri, 3 Apr 2026 16:55:15 -0400 Subject: [PATCH] fallback to sending links if MMS fails --- sgx-bwmsgsv2.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sgx-bwmsgsv2.rb b/sgx-bwmsgsv2.rb index cf5e30e31e60962214a62ef840b0c7d180fb935f..fb2c8a8d783bd0dadd8c4fe690d4550ba7c5d127 100755 --- a/sgx-bwmsgsv2.rb +++ b/sgx-bwmsgsv2.rb @@ -450,6 +450,12 @@ module SGXbwmsgsv2 LOG.debug("OOB MMS details", url: un.text, body: body.to_s.strip) to_catapult(s, un.text, num_dest, user_id, token, secret, usern) end + }.catch { |e| + LOG.error("Error sending MMS, falling back to sending link", error: e) + unless body.include?(un.text) + s.body = body.empty? ? un.text : "#{body}\n#{un.text}" + end + to_catapult(s, nil, num_dest, user_id, token, secret, usern) } end