Skip to content

Feature/email attachments and non data fields - #4

Merged
dhuf merged 4 commits into
mainfrom
feature/email-attachments-and-non-data-fields
Sep 16, 2026
Merged

dhuf merged 4 commits into
mainfrom
feature/email-attachments-and-non-data-fields

Conversation

@dhuf

@dhuf dhuf commented Sep 16, 2026

Copy link
Copy Markdown
Member

No description provided.

dhuf and others added 4 commits September 16, 2026 10:50
Api/Action/Email.fusion offered EVERY field of the form as a {placeholder} for
the mail body, including the ones that carry no user data — the submit button and
the captcha. Both are registered in fieldTypes.omitted, which is precisely the
list of field types whose values are kept out of {allFormValues} and out of the
mail, so an editor who inserted {submit} or {captcha} got a placeholder that
silently resolves to nothing.

Fields without a name are dropped for the same reason: they cannot be addressed
by a placeholder at all (the honeypot is one).

Both rules are the ones ValidationSchema.fusion already applies to the same set
of fields, down to reading the name off `properties` rather than through a
FlowQuery per field, so the two now agree on what counts as a usable field.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NtwrKskrJU8Q6YbnR19QT6
The DatabaseStorage action stored EVERY submitted value, including the fields
that carry no user data. The captcha is the one that shows: its solution is
several kilobytes of base64, spent the moment it was verified, and it sat in
every row of the DatabaseStorage backend module and every CSV export next to
the name and e-mail an editor is actually there to read.

fieldTypes.omitted is already the list of field types whose values are kept out
of {allFormValues} and out of the mail, and getNonDataFieldNames() already
resolves it to this form's field names — the Email action a few lines above
calls it for exactly this purpose. Storage simply never asked.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NtwrKskrJU8Q6YbnR19QT6
…s #55391)

An upload field left an empty row in the notification mail: the label was
printed, the value was blank. FormService::stringify() knows CachedUploadedFile
(the Fusion-rendered upload path), but FormApiController resolves a submitted
[_uploadedFileIdentifier] into a Neos\Flow\ResourceManagement\PersistentResource,
which stringify() has no branch for. PersistentResource has no __toString()
either, so it is not \Stringable and fell through to the final `return ''`.

The file itself was attached (attachUploads), so the mail carried an attachment
the value list could not account for — with more than one upload field, the
recipient cannot tell which attachment answers which question.

PersistentResource is already imported in this file.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NtwrKskrJU8Q6YbnR19QT6
The e-mail action could attach one thing: what the visitor uploaded
(attachUploads). A file the editorial side wants to send along — the information
sheet, the form to fill in, the directions to the building — had no field, so a
confirmation mail could only ever point at a download page and hope.

Adds an `attachments` property: assets from the media browser, attached to every
mail the action sends, independent of what was submitted. The stream-to-DataPart
step the uploads already used is pulled into attachResource() and now serves
both, so an asset in a cloud storage works for the same reason an upload does.

The property is deliberately unrestricted: which asset sources an installation
may attach from is a project decision, and the README shows the override that
makes it. No size check either — what a mail relay accepts is its own setting.

sendEmail() takes the new argument last so that positional callers, such as a
project's own FormActionHandlerInterface implementation, keep working.

Verified end to end in a PHLU installation: the e2e suite submits the fixture
form with two uploads and an asset picked on the action, and the mail carries
all three.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NtwrKskrJU8Q6YbnR19QT6
@dhuf
dhuf requested a review from lorenzulrich September 16, 2026 08:56
@lorenzulrich
lorenzulrich marked this pull request as ready for review September 16, 2026 09:24
@dhuf
dhuf merged commit df343d9 into main Sep 16, 2026
0 of 3 checks passed
@dhuf
dhuf deleted the feature/email-attachments-and-non-data-fields branch September 16, 2026 09:41
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.

2 participants