docs: Update Email link validation note for allowed schemes and anchor links#837
Draft
promptless-for-oss wants to merge 1 commit into
Draft
Conversation
Mautic PR #16508 broadens save-time Email link validation to accept any scheme-prefixed link (such as tel: and mailto:) and anchor links starting with #, and surfaces the validation error beneath the editor. Update the 'Link validation' note in emails.rst to match.
| .. vale off | ||
|
|
||
| When you save an Email, Mautic checks every link it contains. If a link contains a malformed ``href``, such as ``://example.com``, Mautic blocks the save and shows an error such as 'The email contains an invalid URL: ://example.com'. This stops broken links from going out and disrupting email delivery. To save the Email, fix the link so its ``href`` is a valid, absolute URL that starts with ``http://`` or ``https://``, a ``mailto:`` link, or a Mautic token such as ``{unsubscribe_url}``. | ||
| When you save an Email, Mautic checks every link it contains. If a link's ``href`` is malformed - for example ``://example.com``, which has no scheme - Mautic blocks the save and shows an error beneath the editor, such as 'The email contains an invalid URL: ://example.com'. This prevents broken links from going out and disrupting email delivery. A link is valid when its ``href`` uses a scheme such as ``http://``, ``https://``, ``mailto:``, or ``tel:``, is an anchor link that starts with ``#``, or is a Mautic token such as ``{unsubscribe_url}``. Fix any flagged link, then save the Email again. |
Contributor
Author
There was a problem hiding this comment.
Broadened the list of valid link forms per PR #16508. Its new hasValidScheme() method in ValidEmailLinksValidator.php accepts any URL beginning with # or with a non-empty scheme returned by parse_url(..., PHP_URL_SCHEME), so tel:, mailto:, and anchor links now save; the earlier note only allowed absolute http(s):// URLs, mailto:, or tokens. The Email/form.html.twig change surfaces the 'invalid URL' error beneath the editor, which is why the note says the error appears beneath the editor.
Source: mautic/mautic#16508
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Open this suggestion in Promptless to view citations and reasoning process
Updates the 'Link validation' note in channels/emails.rst so it matches the broadened save-time Email link validation from mautic/mautic PR #16508. The note now says a link is valid when its href uses any scheme (such as http://, https://, mailto:, or tel:), is an anchor link starting with #, or is a Mautic token — replacing the earlier, now-inaccurate wording that only allowed absolute http(s) URLs, mailto:, or tokens. Also notes that the validation error now appears beneath the editor. Targets the 7.2 branch (mautic/mautic 7.x).
Trigger Events
Tip: Tag @Promptless in a GitHub issue to turn it into a documentation update 🐙