Skip to content

fix: email formatting and links - #6

Merged
connykaelinvisol merged 3 commits into
mainfrom
fix/email-formatting-and-links
Oct 7, 2026
Merged

connykaelinvisol merged 3 commits into
mainfrom
fix/email-formatting-and-links

Conversation

@connykaelinvisol

Copy link
Copy Markdown
Contributor
  • Format dates as dd.mm.yyyy and keep line breaks in form e-mails
  • Resolve node:// and asset:// links in e-mail body and message action text

connykaelinvisol and others added 3 commits October 7, 2026 15:22
A Field.Date submits an ISO date string (yyyy-mm-dd), so FormService::stringify()
returned it verbatim and the existing DateTime -> d.m.Y branch was never reached.
Detect an exact ISO date and reformat it to d.m.Y (rejecting impossible dates so
they are not silently rolled over), leaving every other string untouched.

User line breaks (e.g. from a textarea) were flattened because the value was
injected raw into the HTML mail. Escape the value and nl2br() it so the breaks
survive into the HTML part; Html2Text turns the <br> back into newlines for the
plaintext part. This also closes an escaping gap in getAllFormValuesHtml().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The headless submit path reads the Email body and Message action properties
directly in PHP, bypassing the Content API's URI conversion that handles every
other rich-text property. Internal Neos links therefore reached the recipient as
raw asset://<uuid> / node://<uuid> strings.

Resolve them in FormApiController via the already-injected LinkingService, reusing
the same pattern as Networkteam.Neos.ContentApi's PropertiesImplementation and the
Redirect action: absolute URLs for the e-mail body (relative links are useless in
a mail), relative for the on-site Message.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PHPStan narrows the scheme capture group of PATTERN_SUPPORTED_URIS to
'node'|'asset', so the explicit 'asset' match arm reads as always-true and the
default as dead code (match.alwaysTrue). Use an if/else instead; the else branch
is the asset case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@connykaelinvisol
connykaelinvisol merged commit 23a15cd into main Oct 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant