Type template id as string to allow aliases (#119)#125
Merged
Conversation
EmailMessageTemplate.TemplateId was a Guid, but the send-email API accepts either a UUID or a user-assigned alias string for template.id. Typing it as Guid made hosted templates identified by alias impossible to send. Change it to string, which handles both.
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Changes type of TemplateId from Guid to string to support template aliases. Adds serialization tests for alias IDs. Low-impact, well-tested.
Re-trigger cubic
This was referenced Jul 9, 2026
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.
Resolves #119.
Problem
EmailMessageTemplate.TemplateId(thetemplate.idsent with an email) was typed asGuid. The send-email API accepts either a UUID or a user-assigned alias string fortemplate.id(server validatesz.union([z.guid(), z.string().max(54)])). Typing it asGuidmakes it impossible to send a hosted template identified by its alias.Fix
Change
TemplateIdfromGuidtostring, which accepts both a UUID and an alias. This only affects the send path; the template-management APIs (retrieve/update/delete/publish/duplicate) keep theirGuidid and their existingstringalias overloads.Verification
Build + full suite on .NET 8: 117/117 pass (2 new serialization tests for alias ids).
Summary by cubic
Allow sending templates by alias by changing
EmailMessageTemplate.TemplateIdto a string. The send API now accepts both UUID and alias values fortemplate.id.EmailMessageTemplate.TemplateIdtostring(useguid.ToString()if needed).Guidid with existing alias overloads).Written for commit 6483688. Summary will update on new commits.