Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email validation fix #172

Merged
merged 4 commits into from
Oct 7, 2020
Merged

Email validation fix #172

merged 4 commits into from
Oct 7, 2020

Conversation

DaveConvery
Copy link
Contributor

This is additional validation using Salesforce's own regex to match their email rules: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/using_regular_expressions_to_validate_email_addresses.htm

I've tested this with quite a few email addresses and the main issue I can see is that it flatly rejects emails with uppercase characters. Since email addresses should be (largely) case-insensitive this feels like overkill.

We could:

  • Run with it (maybe expand the error message?) since there's some value to it
  • Just pass through a lowercase version of whatever's typed into the test
  • Strip that validation out of the regex (feels like there's probably value in matching SFDC exactly for maintainability)

What do people think?

Copy link
Contributor

@philscott-rg philscott-rg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! And it handles the . character in the username like we hoped

Just pass through a lowercase version of whatever's typed into the test

I think this sounds like the best way round the case-sensitivity

Copy link
Contributor

@philscott-rg philscott-rg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updating this to 'request changes' because I guess the case-sensitivity thing still needs to go in before it's merged

@DaveConvery
Copy link
Contributor Author

I've added that and tested it against ALL CAPS

@DaveConvery
Copy link
Contributor Author

Thanks - will merge and deploy tomorrow so we can keep an eye on it.

@DaveConvery DaveConvery merged commit 06355a2 into master Oct 7, 2020
@DaveConvery DaveConvery deleted the email-validation-fix branch October 7, 2020 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants