Skip to content

Type template id as string to allow aliases (#119)#125

Merged
felipefreitag merged 1 commit into
mainfrom
fix/template-id-string
Jul 9, 2026
Merged

Type template id as string to allow aliases (#119)#125
felipefreitag merged 1 commit into
mainfrom
fix/template-id-string

Conversation

@felipefreitag

@felipefreitag felipefreitag commented Jul 9, 2026

Copy link
Copy Markdown
Member

Resolves #119.

Problem

EmailMessageTemplate.TemplateId (the template.id sent with an email) was typed as Guid. The send-email API accepts either a UUID or a user-assigned alias string for template.id (server validates z.union([z.guid(), z.string().max(54)])). Typing it as Guid makes it impossible to send a hosted template identified by its alias.

Fix

Change TemplateId from Guid to string, which accepts both a UUID and an alias. This only affects the send path; the template-management APIs (retrieve/update/delete/publish/duplicate) keep their Guid id and their existing string alias 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.TemplateId to a string. The send API now accepts both UUID and alias values for template.id.

  • Migration
    • Update usages of EmailMessageTemplate.TemplateId to string (use guid.ToString() if needed).
    • Template-management APIs are unchanged (still Guid id with existing alias overloads).

Written for commit 6483688. Summary will update on new commits.

Review in cubic

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

Teplate ID should not be a Guid

1 participant