Skip to content

docs: Update Email link validation note for allowed schemes and anchor links - #837

Merged
adiati98 merged 8 commits into
mautic:7.2from
Promptless:promptless/email-link-scheme-validation-7.2
Jul 28, 2026
Merged

docs: Update Email link validation note for allowed schemes and anchor links#837
adiati98 merged 8 commits into
mautic:7.2from
Promptless:promptless/email-link-scheme-validation-7.2

Conversation

@promptless-for-oss

@promptless-for-oss promptless-for-oss commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Open this suggestion in Promptless to view citations and reasoning process

Updates the 'Link validation' note in channels/emails.rst so it matches the save-time Email link validation from mautic/mautic PR #16508. The note explains that when you save an Email, Mautic validates every link and blocks the save with an error such as 'The email contains an invalid URL: ...' when a link uses an invalid format (for example ://example.com, which has no scheme). A link is valid when its href uses one of the seven accepted schemes (http, https, ftp, ftps, mailto, tel, or sms), is an anchor link that starts with #, or is a Mautic token such as {unsubscribe_url}. Targets the 7.2 branch (mautic/mautic 7.x).

Review feedback

Trigger Events


Tip: Tag @Promptless in a GitHub issue to turn it into a documentation update 🐙

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.
Comment thread docs/channels/emails.rst Outdated
Comment thread docs/channels/emails.rst Outdated
Address @adiati98's suggestion on PR mautic#837: 'checks every link' ->
'validates every link' and 'href is malformed' -> 'href uses an
invalid format' in the Link validation note.
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Thanks, @adiati98 — your suggestion has been applied verbatim to the 'Link validation' note in docs/channels/emails.rst: "checks every link" → "validates every link" and "href is malformed" → "href uses an invalid format", with no other changes. Vale passes cleanly. Ready for another look.

@JonasLudwig1998

Copy link
Copy Markdown
Contributor

Why not list all valid schemes from the PR in your docu?

Address PR mautic#837 review from @JonasLudwig1998 asking why the note didn't
list all valid schemes. Enumerate the complete finite allowlist from
mautic/mautic PR #16508 (http, https, ftp, ftps, mailto, tel, sms) instead
of the open-ended 'such as' phrasing, and note that http(s)/ftp(s) links
must also be structurally valid URLs while mailto/tel/sms need only the
scheme.
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Good catch, @JonasLudwig1998 — done. The 'Link validation' note now lists the complete set of accepted URL schemes (http, https, ftp, ftps, mailto, tel, and sms) instead of the earlier open-ended "such as" phrasing that only gave examples and left out ftp, ftps, and sms. It also now clarifies that http/https/ftp/ftps links must be structurally valid URLs while mailto/tel/sms need only the scheme, and it keeps the guidance on anchor links (#) and Mautic tokens. Pushed to the branch — ready for another look.

@JonasLudwig1998

Copy link
Copy Markdown
Contributor

Can you keep the changes a bit more compact? Inforamtion like 'beneath the editor,' or 'Fix any flagged link, then save the Email again.' doesn't seem to add extra value in my opinion

Remove low-value phrasing (error location 'beneath the editor', the
'prevents broken links' rationale, and the closing 'fix and resave'
sentence) that reviewer @JonasLudwig1998 flagged as not adding value.
All validity facts (seven schemes, anchor links, Mautic tokens, and the
structural-URL vs scheme-only distinction) are preserved.
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Thanks, @JonasLudwig1998 — the 'Link validation' note is now more compact. We dropped the 'beneath the editor' detail, the 'prevents broken links from going out' rationale, and the closing 'Fix any flagged link, then save the Email again.' line, since they didn't add value. The list of accepted schemes (http, https, ftp, ftps, mailto, tel, sms) plus the anchor-link (#), Mautic-token, and structural-URL details are all still there. Updated diff is pushed to the branch.

@JonasLudwig1998

Copy link
Copy Markdown
Contributor

The last sentence should be removed from my point of view (Links using http, https, ftp, or ftps must also be structurally valid URLs, while mailto, tel, and sms only need the scheme.)

…te per review

Applies @JonasLudwig1998's review feedback on PR mautic#837 to drop the final
sentence of the 'Link validation' note in channels/emails.rst.
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Done, @JonasLudwig1998 — removed the final sentence (the structural-URL vs scheme-only clause) as you suggested. The note is now more compact and still lists the accepted schemes (http, https, ftp, ftps, mailto, tel, sms), anchor links (#), and Mautic tokens, and states that Mautic validates links on save and blocks invalid ones with an error. Pushed to the branch — ready for another look.

Comment thread docs/channels/emails.rst Outdated
Reword the valid-link sentence in channels/emails.rst per the reviewer's
GitHub suggestion on PR mautic#837: colon-introduced scheme list and comma-separated
validity cases. Punctuation only; no factual change.
Comment thread docs/channels/emails.rst Outdated
@adiati98 adiati98 closed this Jul 28, 2026
@adiati98 adiati98 reopened this Jul 28, 2026

@adiati98 adiati98 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review, @JonasLudwig1998! 🚀

@adiati98
adiati98 merged commit 8cf66f9 into mautic:7.2 Jul 28, 2026
5 checks passed
@promptless-for-oss
promptless-for-oss deleted the promptless/email-link-scheme-validation-7.2 branch July 28, 2026 18:35
@adiati98

Copy link
Copy Markdown
Contributor

@all-contributors please add @JonasLudwig1998 for review.

@allcontributors

Copy link
Copy Markdown
Contributor

@adiati98

I've put up a pull request to add @JonasLudwig1998! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants