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

CommentFileSizeAuthor
#2 validate_email_address-2807815-2.patch2.58 KBginovski

Comments

Ginovski created an issue. See original summary.

ginovski’s picture

Assigned: Unassigned » ginovski
Status: Active » Needs review
StatusFileSize
new2.58 KB

This is build on top of https://www.drupal.org/node/2800051 #9 patch.

Status: Needs review » Needs work

The last submitted patch, 2: validate_email_address-2807815-2.patch, failed testing.

miro_dietiker’s picture

Status: Needs work » Postponed (maintainer needs more info)

I 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.

tduong’s picture

Category: Task » Feature request
Issue summary: View changes
Priority: Normal » Minor
Status: Postponed (maintainer needs more info) » Needs review
Related issues: +#2807819: Validate email address (other accounts) in monitoring_mail

This 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.

miro_dietiker’s picture

Status: Needs review » Needs work

We 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