Problem/Motivation
Followup from https://www.drupal.org/node/2800051
Let's say I've set an email address for the monitoring_mail settings, but I did a typo, wonder why I don't get any mail, and later I've figured out it was because I've written "gamil" instead of "gmail". In this case we've used Gmail to test the monitoring_mail implementation, but later we might want to implement a more complex validation to cover other accounts.
This is a simple example, there are many other typos/other kind of errors that other applications/forms validate (such as checking if a certain address exists, etc).
Another generic validation issue has been created: #2807819: Validate email address (other accounts) in monitoring_mail
Proposed resolution
Validate the recipient email for gmail in monitoring mail.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | validate_email_address-2807815-2.patch | 2.58 KB | ginovski |
Comments
Comment #2
ginovski commentedThis is build on top of https://www.drupal.org/node/2800051 #9 patch.
Comment #4
miro_dietikerI really don't get why we want to enforce a gmail address?
We said we want to optimise it with/for gmail UI since we use it. And thus make sure we have nice trees there. But we never defined that other mail addresses are forbidden.
Comment #5
tduong commentedThis is not meant to be for Gmail only, but it is a starting example, since we've tested it with Gmail account.
The goal here was to provide a validation checking if the recipient address that the user has entered is valid.
Example case: I've set an email address, but I did a typo and wonder why I don't get any mail, and later I've figured out it was because I've written "gamil" instead of "gmail". In this case gmail but later we might want to implement a more complex validation to cover other accounts. Also this is a simple example, there are many other typos/other kind of errors that other applications/forms validate (such as checking if a certain address exists, etc).
Another generic validation issue has been created here: #2807819: Validate email address (other accounts) in monitoring_mail
Anyway, for now this is just a nice to have I guess. We can define how to handle this later when everything is ready.
Comment #6
miro_dietikerWe don't need to reinvent the wheel.
There is a field widget of type email and all those checks are implemented already.
See \Drupal\Core\Render\Element\Email