From fdd10417cace00040586548dce0c1dfe89f422d5 Mon Sep 17 00:00:00 2001 From: Sonia Connolly Date: Thu, 8 Jun 2023 16:03:27 -0700 Subject: [PATCH 1/4] Add Australia (AU) to SENDER_ID_COUNTRIES AWS updated their Supported countries and regions (SMS channel) to say that Australia needs sender ID, but we're not seeing that, so we are adding it to our list of SENDER_ID_COUNTRIES. https://docs.aws.amazon.com/pinpoint/latest/userguide/channels-sms-countries.html Co-authored-by: Gina Yamada Co-authored-by: Matt Hinz --- lib/pinpoint_supported_countries.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pinpoint_supported_countries.rb b/lib/pinpoint_supported_countries.rb index b3452fcaee1..a88a6fd05bf 100644 --- a/lib/pinpoint_supported_countries.rb +++ b/lib/pinpoint_supported_countries.rb @@ -11,6 +11,7 @@ class PinpointSupportedCountries # The list of countries where we have our sender ID registered SENDER_ID_COUNTRIES = %w[ + AU BY EG FR From 1460e94a2c0cc0f581e1979aa8513477efa771a7 Mon Sep 17 00:00:00 2001 From: Sonia Connolly Date: Thu, 8 Jun 2023 16:13:05 -0700 Subject: [PATCH 2/4] Create exception list for sender id countries We don't want to try to send a sender_id to a country where it is not registered. Co-authored-by: Zach Margolis Co-authored-by: Gina Yamada --- lib/pinpoint_supported_countries.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/pinpoint_supported_countries.rb b/lib/pinpoint_supported_countries.rb index a88a6fd05bf..902b43e8825 100644 --- a/lib/pinpoint_supported_countries.rb +++ b/lib/pinpoint_supported_countries.rb @@ -11,7 +11,6 @@ class PinpointSupportedCountries # The list of countries where we have our sender ID registered SENDER_ID_COUNTRIES = %w[ - AU BY EG FR @@ -20,6 +19,12 @@ class PinpointSupportedCountries TH ].to_set.freeze + # Countries where AWS claims sender ID is required, and we don't have one, and + # it seems to work anyway. + SENDER_ID_EXCEPTION_COUNTRIES = %w[ + AU + ].to_set.freeze + CountrySupport = Struct.new( :iso_code, :name, @@ -70,7 +75,7 @@ def sms_support iso_code = sms_config['ISO code'] supports_sms = case trim_spaces(sms_config['Supports Sender IDs']) when 'Registration required1' - SENDER_ID_COUNTRIES.include?(iso_code) + SENDER_ID_COUNTRIES.include?(iso_code) || SENDER_ID_EXCEPTION_COUNTRIES.include?(iso_code) when 'Registration required3' # basically only India, has special rules true else From bea562a0fa8f12624d2491dcdcf6435f5a9f6c87 Mon Sep 17 00:00:00 2001 From: Sonia Connolly Date: Thu, 8 Jun 2023 16:17:35 -0700 Subject: [PATCH 3/4] Test our work --- spec/lib/pinpoint_supported_countries_spec.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/spec/lib/pinpoint_supported_countries_spec.rb b/spec/lib/pinpoint_supported_countries_spec.rb index a190efba028..7f311420b18 100644 --- a/spec/lib/pinpoint_supported_countries_spec.rb +++ b/spec/lib/pinpoint_supported_countries_spec.rb @@ -150,11 +150,22 @@ stub_const('PinpointSupportedCountries::SENDER_ID_COUNTRIES', []) end - it 'is supported' do + it 'is not supported' do belarus = countries.sms_support.find { |c| c.iso_code == 'BY' } expect(belarus.supports_sms).to eq(false) end end + + context 'when we do not have a sender ID and the country is on our exceptions list' do + before do + stub_const('PinpointSupportedCountries::SENDER_ID_EXCEPTION_COUNTRIES', %w[BY]) + end + + it 'is supported' do + belarus = countries.sms_support.find { |c| c.iso_code == 'BY' } + expect(belarus.supports_sms).to eq(true) + end + end end describe '#voice_support' do From 3a7fbe7fc90b055da663ac13a6017c2654eb230d Mon Sep 17 00:00:00 2001 From: Sonia Connolly Date: Thu, 8 Jun 2023 16:18:14 -0700 Subject: [PATCH 4/4] changelog changelog: Internal, International SMS configuration, Update Australia to not require a sender_id