Repository navigation
feat(dms-mailing): send template e-mails with attachments - #201
Merged
Merged
Conversation
Keep SendTemplateParams.attachments, their pass-through to the email provider, one fixed ceiling (10 files, 10 MiB), the file name's last path segment without line breaks, the json_attachments log summary, the 409 on a replay and the file list in the send drawer. Drop GetSendCapabilities and SendCapabilities, SendErrorCode, the provider features probe, the maxAttachments and maxAttachmentBytes options, the zod schema, the grapheme, bidi, MIME type and multipart rules, the journey (the integration test covers it) and the test SMTP recorder, which main's mail store replaces.
Upd4ting
force-pushed
the
feat/template-attachments
branch
from
November 20, 2026 14:43
3bd99a1 to
71a020e
Compare
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.
Summary
W05057e83-10.
SendTemplatenow carries attachments.@antelopejs/interface-emailalready accepts files, butSendTemplatehad nowhere to put them, so Altab could not attach its invoice PDFs. Taken over from Maxime's first version and cut down to the pass-through, per the CTO review.SendTemplateParams.attachments?: SendAttachment[], withSendAttachment { filename, contentType?, content: Uint8Array }. ABufferis aUint8Array.prepareturns the files intointerface-emailBufferAttachments once.messageForpasses them toSendandSendBatchfor every recipient.codeattachments_too_largebefore anything is sent or logged.json_attachmentskeeps each file's name, type, size and SHA-256, never its bytes. It is written for every recipient, suppressed ones included.409 $dms_mailing.errors.no_replay_with_attachments. The drawer footer offers neither for such a send.SendErrormoves toservices/send-error.tssoservices/attachments.tscan throw it without pushingsend.tspast the 500-line lint cap.Cut from the first version
GetSendCapabilitiesandSendCapabilities,SendErrorCode, the providerfeatures.attachmentsprobe, themaxAttachmentsandmaxAttachmentBytesmodule options, the zod schema, grapheme segmentation, bidi stripping, the 200-grapheme cut, the MIME regex, the multipart and message refusal, thesend-from-codeattachments journey (the integration test covers the same path in-process), and the test SMTP recorder (main'shelpers/mail-storealready keeps every raw message).⚠ sensitive: adds the stored field
json_attachmentstomailing_sendsand a field to the publicSendTemplateParamscontractRelease
Release
@antelopejs/interface-dms-mailingfirst, then the module. No migration:json_attachmentsis optional, and old rows have none.Proof
src/test/integration/send-attachments.test.tsruns the real nodemailer transport against the SMTP fixture and reads the raw messages.Before, on
mainwith the same test file (the type errors are expected:attachmentsdoes not exist there yet):After, on this branch:
Also run locally:
pnpm run typecheck,oxlint,oxfmt --check, the frontendlint, the layer testsattachments,send-drawerandsend-actions(26 passing),unit/send.test.js(12 passing), and the integration filessend-failures,send-figures,send-import,send-lifecycle,send-talliesandsends(all passing).flowchart LR A["SendTemplate(slug, { attachments })"] --> B{"checkAttachments: over 10 files or 10 MiB?"} B -- yes --> R["reject attachments_too_large, nothing sent or logged"] B -- no --> C["BufferAttachment[]: last path segment, no CR/LF"] C --> D["messageFor → interface-email Send / SendBatch"] C --> E["send row: json_attachments = name, type, size, SHA-256"] E --> F["POST /sends/:id/replay → 409 no_replay_with_attachments"]Follow-ups