Repository navigation
feat: template-level shell defaults and structured attributes - #42
Merged
Merged
Conversation
- htmlAttributes / bodyAttributes accept a raw string or a structured map. - openTag / serializeAttributes handle both shapes (raw interpolation). - EmailTemplate.shell holds default DocumentShellOptions; per-render props override them. - composeEmail merges the two and forwards the result to document(). A Postmark-style or styled-body template can declare its shape once.
Rendered emailsThis PR rendered email templates.
Open the run → Artifacts → download → open |
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.
Cycle 3: specialized document shapes can be declared once on the template, and attributes can be supplied as a structured map instead of only a raw string.
Changes
htmlAttributesandbodyAttributesaccept either a raw string or aRecord(booleantrueemits a bare attribute;false/null/undefinedare omitted). Values stay raw, matching the package policy.openTag/serializeAttributeshandle both shapes.EmailTemplategains an optionalshell?: DocumentShellOptions.defineEmailTemplatestores it andcomposeEmailmerges it with per-render props (props win).TagAttributes,openTag, andserializeAttributes.A Postmark-style template can now set its XHTML doctype,
xmlns, and body styles once on the template definition. Per-render props can still override any of them. Defaults for ordinary HTML5 emails are unchanged.This branch includes the earlier document-shell and email-forwarding commits.