Skip to content
New issue

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

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

Already on GitHub? # to your account

Email is not expanded in error message #1025

Open
gemal opened this issue Dec 3, 2020 · 2 comments
Open

Email is not expanded in error message #1025

gemal opened this issue Dec 3, 2020 · 2 comments
Labels
status: help wanted requesting help from the community type: bug bug in the library

Comments

@gemal
Copy link

gemal commented Dec 3, 2020

Got this error:
ERROR: error: '"$emailAddress" must be a valid email address. Got: xxxxx@gmailæ.com' - #0 sendgrid/sendgrid/lib/mail/EmailAddress.php(69): SendGrid\Helper\Assert::email('xxxxx@gma...', 'emailAddress')

$emailAddress should be expanded

* @expectedExceptionMessage "$emailAddress" must be a string.

is also wrong:
"$name" must be a string ?

I think that test is all wrong

@thinkingserious
Copy link
Contributor

Hello @gemal,

Thanks for bringing that to our attention! This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

With best regards,

Elmer

@thinkingserious thinkingserious added status: help wanted requesting help from the community type: bug bug in the library labels Jan 8, 2021
@bancer
Copy link

bancer commented Jan 28, 2021

@thinkingserious filter_var used in SendGrid\Helper\Assert::email does not support unicode emails. According to PHP docs FILTER_FLAG_EMAIL_UNICODE is applied only to the local part of the email address. Would it be okay to change it to matching ^(?!\.)((?!.*\.{2})[a-zA-Z0-9\u00E0-\u00FC.!#$%&'*+-/=?^_`{|}~\-\d]+)@(?!\.)([a-zA-Z0-9\u00E0-\u00FC\-\.\d]+)((\.([a-zA-Z]){2,63})+)$ regex (from https://www.regextester.com/108260)?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
Development

No branches or pull requests

3 participants