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

Mailto links should be allowed in URL fields #5497

Closed
davist11 opened this issue Jan 24, 2020 · 7 comments
Closed

Mailto links should be allowed in URL fields #5497

davist11 opened this issue Jan 24, 2020 · 7 comments
Labels
content modeling 📓 features related to content modeling enhancement improvements to existing features
Milestone

Comments

@davist11
Copy link
Contributor

Description

mailto:test@test.com is a valid URL for <input type="url">, but they fail the validation in craft\validators\UrlValidator.

Steps to reproduce

  1. Add a URL field to a section
  2. Enter mailto:test@test.com in the field and save.
  3. See the error message [fieldname] is not a valid URL.

Additional info

  • Craft version: Craft Pro 3.3.20.1
  • PHP version: 7.1.32
  • Database driver & version: MySQL 5.5.5
  • Plugins & versions:
Asset Rev 6.0.2
Azure Blob Remote Volume 1.0.2
Calendar 2.0.25
Navigation 1.2.7
Redactor 2.4.0
Redirect plugin for Craft 3 1.0.23
Super Table 2.3.3
Video Embed 1.2.1
VZ Address 2.0.2
Width Fieldtype 1.0.6
@brandonkelly brandonkelly added content modeling 📓 features related to content modeling enhancement improvements to existing features labels Jan 27, 2020
@TUSAB-web
Copy link

This still appears to be an issue in Pro 3.5.14

@am0
Copy link

am0 commented Nov 11, 2020

Just giving this a bump as I had to switch a field from a URL field to a Plain Text field today so that users could use mailto: links.

@nathansnelgrove
Copy link

Giving this a bump as well; I find I frequently need to use Plain Text fields instead of url fields because of this issue.

@brandonkelly
Copy link
Member

This is resolved for the next 3.6 release ✨

URL fields now have an “Allowed URL Types” setting, with “Web page”, “Telephone”, and “Email” options:

The new “Allowed URL Types” setting

When 2+ options are checked, a dropdown will be displayed to the left of the URL input, which lists the options you’ve selected.

A URL field with the “Email” input type selected

Phone numbers will get a tel: prefix added; emails will get a mailto: prefix. But those will be hidden from the actual UI.

@brandonkelly brandonkelly added this to the 3.6 milestone Jan 11, 2021
@brandonkelly
Copy link
Member

Craft 3.6 has now been officially released ✨

@melissadoyon
Copy link

Awesome! Any chance we could also get this ability when the URL field is within a Table field? Thanks

@brandonkelly
Copy link
Member

@melissadoyon Just created a new issue for that: #7512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content modeling 📓 features related to content modeling enhancement improvements to existing features
Projects
None yet
Development

No branches or pull requests

6 participants