Conversation
The handler returned a bare `new Entity("email")`, so anything reading the
instantiated subject or body got nothing, and calls naming records that do not
exist succeeded silently.
The retrieve/validate/render sequence is now shared with SendEmailFromTemplate
through EmailTemplateInstantiator; the two messages differ only in what they do
with the merged content. InstantiateTemplate returns it, SendEmailFromTemplate
copies it onto the target and creates + sends.
Verified against a live org (InstantiateTemplate persists nothing, so it is safe
to call directly): the response carries subject and description only, with the
body in the same HTML envelope SendEmailFromTemplate returns; a missing template
or record and a templatetypecode mismatch each fault, the mismatch taking
precedence over the record lookup. The ObjectType guards now use Dataverse's own
messages instead of "ObjectType is missing".
680 tests pass, net462 builds clean.
Claude-Session: https://claude.ai/code/session_01YWUbYsznntsbtkmxHDcvaa
Bircck
force-pushed
the
instantiate-template-render
branch
from
September 3, 2026 10:48
3da19ff to
93d3b10
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.
Stacked on #331 — targets
worktree-send-email-from-templatefor the shared renderer. Merge #331 first; this rebases onto master afterwards.InstantiateTemplateRequestHandlerreturned a barenew Entity("email"). Anything reading the instantiated subject or body got nothing, and calls naming records that don't exist succeeded silently.What changed
The retrieve → validate → render sequence is now shared with
SendEmailFromTemplatethroughEmailTemplateInstantiator. The two messages differ only in what they do with the merged content:InstantiateTemplatereturns it,SendEmailFromTemplatecopies it onto the target and creates + sends.ObjectTypeguards now use Dataverse's messages (Required field 'ObjectType' is missing…/Expected non-empty string.) rather thanObjectType is missing.Verification
InstantiateTemplatepersists nothing, so it was safe to call directly against a live org. Every behaviour below is asserted in the tests:email, attributessubject+descriptiononly, empty idSendEmailFromTemplatereturnstemplate With Id = … Does Not ExisttemplatetypecodemismatchTemplate type is incorrect for given objectType 2 != 1 template.templatetypecode, raised before the record lookupThe three pre-existing tests passed random GUIDs for
TemplateId/ObjectId, which the stub accepted; they now use real records. Five tests total, 680 in the suite,net462builds clean.https://claude.ai/code/session_01YWUbYsznntsbtkmxHDcvaa