episphere / connect

Connect API for DCEG's Cohort Study
10 stars 5 forks source link

Fix email addresses containing spaces #1106

Open we-ai opened 2 weeks ago

we-ai commented 2 weeks ago

Issue found:

Things to do:

@brotzmanmj @anthonypetersen Please comment.

anthonypetersen commented 2 weeks ago

I would say the most important piece is putting logic in the PWA to stop this from happening in the future. We could easily find an email regex out there that would clean this up.

Cleaning up the emails with leading or tailing spaces isn't too difficult, but the ones with spaces in the middle I worry we would make an incorrect assumptions sometimes by just removing the space.

we-ai commented 2 weeks ago

I would say the most important piece is putting logic in the PWA to stop this from happening in the future. We could easily find an email regex out there that would clean this up.

Cleaning up the emails with leading or tailing spaces isn't too difficult, but the ones with spaces in the middle I worry we would make an incorrect assumptions sometimes by just removing the space.

Totally agreed. Spaces in the middle are tricky, but we don't have other options aside from removing them. Since spaces are not allowed in the middle, even we consider them correct, sending emails to these addresses won't succeed.

we-ai commented 2 weeks ago

Another thing to add. Maybe a participant should've received multiple emails already, but never received an email because the email address contains space(s). Once the email address is fixed and without any restrictions, he/she may receive the blocked emails all at once, some emails (e.g. one-year anniversary, etc) might've passed due already thus not appropriate.

So before fixing email addresses, we may need to add placeholder emails to block unnecessary emails to participants.

brotzmanmj commented 2 weeks ago

I agree the higher priority is to add something to the PWA to prevent them from adding bad email addresses. I will add to the list of User Profile changes that are planned for Fall 2024.

For correcting existing ones, I think we should test in dev or stage to see if they will actually get the past messages or not.

we-ai commented 1 week ago

Update on 9/3. When dry running "3mo QOL Survey Reminders" 2nd contact in prod, of the 16705 checked participant data entries, there were 5 email addresses that contained spaces and failed to pass email format check. Below are tokens:

brotzmanmj commented 1 week ago

Thanks @we-ai . We don't currently have a process in place to fix these, so we will assume these participants will not get the email. The SMS reminder should go out today so hopefully that will reach these participants.

we-ai commented 1 week ago

@brotzmanmj Yes, SMS messages will be sent to them today, since these 5 participants all have "can we text" (CID 646873644) value as "yes"(CID 353358909).

we-ai commented 1 week ago

On 9/6, when dry running "3mo QOL Survey Reminders" 3rd contact in prod, there were 5 email addresses that contained spaces and failed to pass email format check. Tokens are same as those found when dry running 2nd contact.