Addresses LP bug
1016654 - Despite the hint telling users not to use
hyphens when entering a text notification number, we have patrons who
are entering the hyphens causing the text notification to fail.
Munge "pretty printed" numbers into raw sets of digits in the A/T helper.
This allows aliases to still work for services that support them.
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Michael Peters <mrpeters@library.in.gov>
Signed-off-by: Ben Shum <bshum@biblio.org>
};
my $carriers = new_editor()->json_query($query);
+ # If this looks like a pretty-formatted number drop the pretty-formatting
+ # Otherwise assume it may be a literal alias instead of a real number
+ if ($sms_notify =~ m/^[- ()0-9]*$/) {
+ $sms_notify =~ s/[- ()]//g;
+ }
+
my @addresses = ();
foreach my $carrier ( @{ $carriers } ) {
my $address = $carrier->{email_gateway};