Salesforce-org-Impact-Labs / 01HousingandHomelessness

Impact Lab - Housing & Homelessness
BSD 3-Clause "New" or "Revised" License
12 stars 12 forks source link

SMS referral notification to client fails to be received #254

Open fifedog opened 3 years ago

fifedog commented 3 years ago

When the referral SMS message is sent to the client, the message is never received.

Steps to reproduce:

  1. Add your mobile phone to the client record, and your email.
  2. Create a Service referral for client via SMS
  3. Run refrec.Batch_SendInitialClientReferrals batchable = new refrec.Batch_SendInitialClientReferrals(); Database.executeBatch(batchable); in Anonymous APEX

Result

  1. Email is received to your email address.
  2. The recipient for your phone number is incorrect. The value is ###.###.####@[phone provider email] when it should be only numbers: ##########@[phone provider email]
fifedog commented 3 years ago

Just to be sure it's clear, there are periods, ".", in the phone number value when there shouldn't be.

ShashiChettepu commented 3 years ago

Hi @fifedog, I tried to reproduce the issue.

fifedog commented 3 years ago

@ShashiChettepu - So is this something that you are able to change?

szeitz commented 3 years ago

Hey @fifedog, @ShashiChettepu has a fix in his scratch org. We're going to work to get that in a branch so we can spin up a test org and qa it to make sure it is working as expected. We'll share that org with you once it is ready.

szeitz commented 3 years ago

Code is placing periods in the phone number how it is being sent. Test - put in a normal phone number like 555-555-5555 Results - the code is changing the phone number to 555.555.5555 Expect Results - code should not care what phone number format is. It should format it correctly and escape special characters before sending out sms message. examples (555)555-5555, 555-555-5555, 555.555.5555