Skip to content

[TW-4797] Add hosted templates and workflows support#45

Merged
qasim-nylas merged 2 commits intomainfrom
feature/TW-4797-hosted-templates-workflows
Apr 8, 2026
Merged

[TW-4797] Add hosted templates and workflows support#45
qasim-nylas merged 2 commits intomainfrom
feature/TW-4797-hosted-templates-workflows

Conversation

@sourcesoft
Copy link
Copy Markdown
Member

Summary

This PR adds full hosted templates and workflows support to the CLI.

It introduces dedicated template and workflow command groups for app-scoped and grant-scoped hosted resources, integrates hosted-template rendering into nylas email send, updates the docs, and expands unit/integration coverage.

What changed

Hosted templates and workflows

  • Added domain models and ports for hosted templates, template rendering, and workflows.
  • Implemented HTTP adapter support for app-scoped and grant-scoped template/workflow CRUD and render operations.
  • Added mock and demo client implementations for the new APIs.
  • Wired new top-level CLI groups:
    • nylas template list|show|create|update|delete|render|render-html
    • nylas workflow list|show|create|update|delete
  • Added shared CLI helpers for scope resolution, JSON file loading, and grant identifier handling.

Hosted-template email send integration

  • Extended nylas email send to support hosted templates directly with:
    • --template-id
    • --template-scope
    • --template-grant-id
    • --template-data
    • --template-data-file
    • --render-only
    • --template-strict
  • Ensured hosted-template rendering also works on the GPG send path.
  • Added render-only preview support without requiring an unrelated send grant for app-scoped previews.

Grant identifier correctness

  • Fixed grant-scoped identifier resolution so explicit email identifiers are resolved from local grant state instead of silently falling back to NYLAS_GRANT_ID.
  • Added isolated integration harness support to seed a temporary encrypted local grant store so email-based grant resolution is tested correctly.

Documentation

Updated command docs for the new CLI surface and hosted-template send flow in:

  • docs/COMMANDS.md
  • docs/commands/email.md
  • docs/commands/templates.md
  • docs/commands/workflows.md

Testing

Added/expanded coverage

  • Adapter unit tests for hosted template/workflow operations.
  • CLI unit tests for template/workflow commands and hosted-template send behavior.
  • Integration tests for:
    • template CRUD/list/render/render-html
    • workflow CRUD/list
    • app scope and grant scope
    • file-backed inputs
    • render-only hosted-template preview
    • hosted-template send paths
    • self-send hosted-template round trip
    • email-based grant identifier resolution

Verification

  • make ci-full

This passed locally, including:

  • formatting
  • vet
  • lint
  • unit tests
  • race tests
  • security scan
  • vuln check
  • build
  • integration tests
  • Air integration tests
  • test cleanup

Notes

A small set of existing test files outside the feature area were also updated to resolve pre-existing lint/staticcheck blockers uncovered while getting make ci-full green. Those changes are mechanical test-quality fixes needed for the full pipeline to pass.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6470c4b105

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@qasim-nylas qasim-nylas self-requested a review April 8, 2026 11:29
Copy link
Copy Markdown
Collaborator

@qasim-nylas qasim-nylas left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@qasim-nylas qasim-nylas merged commit cf4ee83 into main Apr 8, 2026
6 checks passed
@qasim-nylas qasim-nylas deleted the feature/TW-4797-hosted-templates-workflows branch April 8, 2026 11:29
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.

3 participants