lib/customer_ogm.rb 🔗
@@ -56,7 +56,7 @@ module CustomerOGM
end
def formatted_tel
- @tel.sub(/\A\+?1?(\d{3})(\d{3})/, "(\\1) \\2-")
+ @tel.sub(/\A\+?1(\d{3})(\d{3})(\d+)/, "\\1.\\2.\\3").gsub(/(?=\d)/, " ")
end
def to_render
Stephen Paul Weber created
Old one does not work well for our self hosted one
lib/customer_ogm.rb | 2 +-
test/test_customer_ogm.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
@@ -56,7 +56,7 @@ module CustomerOGM
end
def formatted_tel
- @tel.sub(/\A\+?1?(\d{3})(\d{3})/, "(\\1) \\2-")
+ @tel.sub(/\A\+?1(\d{3})(\d{3})(\d+)/, "\\1.\\2.\\3").gsub(/(?=\d)/, " ")
end
def to_render
@@ -26,7 +26,7 @@ class CustomerOGMTest < Minitest::Test
</vcard4>
XML
assert_equal(
- [:voicemail_ogm_tts, { locals: { fn: "(555) 123-4567" } }],
+ [:voicemail_ogm_tts, { locals: { fn: " 5 5 5. 1 2 3. 4 5 6 7" } }],
CustomerOGM::TTS.new("+15551234567", vcard).to_render
)
end