Wagtail: Unable to add parameters to mailto links

Created on 13 Apr 2020  路  1Comment  路  Source: wagtail/wagtail

Issue Summary

Using the rich text editor, you cannot add additional URI parameters to a mailto link such as subject, bcc, cc, etc. You can only pass a single email address.

Steps to Reproduce

  1. Create a page or other model with a rich text field, then edit an instance of it
  2. Add text, then hyperlink it
  3. Try to add an email link with additional parameters e.g. [email protected]?subject=Help+Me or [email protected][email protected]
  4. You're told the email is invalid
  5. You're also unable to add an analogous URI but with the "mailto:" scheme under External Link

I think the solution could be to validate not against an email address, but a mailto URI. I looked at the Draftail repo first but decided to open the issue here, since it seems that the link selection dialog is native to Wagtail and not the editor itself; forgive me if I'm wrong about that.

Any other relevant information. For example, why do you consider this a bug and what did you expect to happen instead?

  • I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: (yes / no)

No, but we are on the latest release (2.8).

Technical details

  • Python version: 3.5.2
  • Django version: 2.2.11
  • Wagtail version: 2.8
  • Browser version: Chrome 80
Bug

Most helpful comment

Hi @phette23 - thanks for the suggestion. A potential issue with having users enter mailto: links is that editor-level users are not necessarily technical, and may not know how to construct them. I think the way forward would be to have a separate optional field for subject / cc in the link chooser, which would then store the link internally as something like <a linktype="email" email="[email protected]" subject="Help me"> - we can then use the existing link-rewriting logic (as used for page and document links) to convert this into a working mailto: URL.

>All comments

Hi @phette23 - thanks for the suggestion. A potential issue with having users enter mailto: links is that editor-level users are not necessarily technical, and may not know how to construct them. I think the way forward would be to have a separate optional field for subject / cc in the link chooser, which would then store the link internally as something like <a linktype="email" email="[email protected]" subject="Help me"> - we can then use the existing link-rewriting logic (as used for page and document links) to convert this into a working mailto: URL.

Was this page helpful?
0 / 5 - 0 ratings