-
Notifications
You must be signed in to change notification settings - Fork 587
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
fix: handle @ in display name when using MailHelper.StringToEmailAddress #903
Conversation
fix email regex to allow email addresses in the display name. Input: [email protected] <[email protected]> Expected: -NameGroup: [email protected] -EmailGroup: [email protected] Initial: -NameGroup: {empty string} -EmailGroup: [email protected] <[email protected] Result: A match is found, therefore there is no error caught and email string is bad After: -NameGroup: [email protected] -EmailGroup: [email protected] Result: Success! Other test cases: -<[email protected]> SUCCESS [email protected] SUCCESS -username <[email protected]> SUCCESS -username <usernameexample.com> NO MATCH (SUCCESS)
Update MailHelper.cs
Hey, this is my first pull request on a major project! I was able to run the tests, however I didn't add any new tests or comments as this is a one line change. |
add test casses for MailHelper.StringToEmail
Add test cases for MailHelper.StringToEmailAddress()
I have added test cases for MailHelper.StringToEmailAddress() |
Hey @Fieora, great job on the PR! I think your changes look good, except for one minor details, and that's the casing of parameters. In C#, it's custom to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fix email regex to allow email addresses in the display name.
Input:
[email protected] <[email protected]>
Expected:
-NameGroup: [email protected]
-EmailGroup: [email protected]
Initial:
-NameGroup: {empty string}
-EmailGroup: [email protected] <[email protected]
Result: A match is found, therefore there is no error caught and email string is bad
After:
-NameGroup: [email protected]
-EmailGroup: [email protected]
Result: Success!
Other test cases:
-
<[email protected]>
SUCCESS-
[email protected]
SUCCESS-
username <[email protected]>
SUCCESS-
username <usernameexample.com>
NO MATCH (SUCCESS)Testing with the updated regular expression can be done here
Fixes
Fixes #902
Checklist
Short description of what this PR does:
If you have questions, please send an email to Twilio Sendgrid, or file a Github Issue in this repository.