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

Unable to add parameters to mailto links #5950

Closed
phette23 opened this issue Apr 13, 2020 · 3 comments · Fixed by #10920
Closed

Unable to add parameters to mailto links #5950

phette23 opened this issue Apr 13, 2020 · 3 comments · Fixed by #10920
Labels
component:Choosers Modal choosers for Page, Snippet and other models component:Rich text type:Enhancement

Comments

@phette23
Copy link
Contributor

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. help@example.com?subject=Help+Me or help@example.com?cc=support@example.com
  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
@gasman
Copy link
Collaborator

gasman commented Apr 13, 2020

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="foo@example.com" 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.

@lb-
Copy link
Member

lb- commented Jul 31, 2023

PR raised a while ago with a partial solution - would be good if anyone is keen to pick that up and redo on the latest code + fix one of the minor feedback items.

#6451

lb- pushed a commit to TopDevPros/wagtail that referenced this issue Sep 26, 2023
@lb- lb- added type:Enhancement component:Choosers Modal choosers for Page, Snippet and other models and removed type:Bug labels Sep 26, 2023
@lb-
Copy link
Member

lb- commented Sep 26, 2023

#10920 has implemented the subject/body request in this issue, we will close when merged.

If support for cc/bcc is still requested, that can be requested as a future enhancement issue, it will likely involve a bit of InlinePanel to allow for multiple adding/re-ordering of a CC and/or BCC address.

lb- pushed a commit that referenced this issue Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:Choosers Modal choosers for Page, Snippet and other models component:Rich text type:Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants