Support Relay-owned draft previews and AISHL footer context
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
調査の方向性
Start with the transactional template routes and rendering service, then read the existing template, preview, send, and API/OpenAPI tests named by the issue. Trace how template keys, published versions, Markdown rendering, layout context, and message creation flow through those entry points. Done means the acceptance criteria pass, including the byte-for-byte AISHL plaintext fixture and validation before any writes or enqueueing.
索引モデルが issue の本文から書いたものです。
説明
Support Relay-owned draft previews and AISL footer context
Status: pending
Tags: transactional, api, email
Depends on: None
Blocks: AI-Shipping-Labs/website#2009
Scope
- Add an explicit draft-preview choice to
POST /api/transactional/templates/{key}/preview.draft: truerenders the current editable draft even when published versions exist. An omitted or false value keeps today's resolution order: requested version, latest published version, then draft when no version exists. A non-boolean returnsdraft: must_be_boolean; combiningdraft: truewithtemplate_versionreturnsdraft: conflicts_with_template_version. - Accept periods in template keys on every keyed template endpoint: detail/upsert, publish, versions, preview, and test-send. This unblocks the four existing AISHL
coursework.*keys without allowing/or changing client scoping. - Add
markdown_layout_contextas a boolean on transactional template drafts and snapshot it into every immutable published version. Expose it in template detail, list, publish, and version payloads. It defaults tofalse; non-boolean upsert values returnmarkdown_layout_context: must_be_boolean. Existing drafts and versions therefore retain their current HTML and plaintext output. - For an opted-in Markdown render source, Relay owns both layout footer rendering and the plaintext equivalent. Only
footer_note,verify_email_url, andunsubscribe_urlmay flow from message context into the client layout. Raw HTML/text render sources remain unchanged. - Validate those three layout values before rendering: empty values are allowed;
footer_notemust be text no longer than 500 characters; URLs must be text, no longer than 2048 characters, and absolutehttporhttpsURLs. Usemust_be_string,too_long, andmust_be_absolute_http_urlas the field error codes. Escape footer text and URL attributes in HTML. No other arbitrary context value reaches the layout. - For opted-in Markdown, produce the same AISHL plaintext contract as the website renderer: normalized Markdown text, layout
brand_name, optional footer note, optional two-line verification action, and optional unsubscribe action, separated in the existing order by blank lines. Add a representative AISHL fixture that covers headings, emphasis, lists, links, footer text, verification, and unsubscribe so parity is byte-for-byte reviewable. - Keep preview, dry-run send, and durable send on the same render-source function. Invalid layout context must fail before contact/message/event creation or enqueueing.
- Document the new preview field, versioned rendering option, dotted-key grammar, validation errors, and response fields in the API/OpenAPI docs.
- Do not alter
campaign-broadcastversion 1, publish or edit live templates, call AWS, or send email in this issue. AISHL will opt new template versions into this contract duringAI-Shipping-Labs/website#2009rollout.
Compatibility Boundary
- Real external client: AI Shipping Labs, while
AI-Shipping-Labs/website#2009removes its local email templates and renderer. - Migration window: the AISHL site remains pinned to existing published versions, including
campaign-broadcastv1, until reviewed opt-in versions are published and the website rollout completes. - Observability: template and version API payloads expose the rendering option; delivered messages already record
template_version. - Removal plan: no compatibility alias or duplicate endpoint is introduced. The opt-in is a first-class Relay rendering contract. The AISHL-local renderer is removed by the blocked website issue after rollout.
Acceptance Criteria
-
GET/PUT, publish, versions, preview, and test-send routes resolve a client-owned key containing periods, including all four existingcoursework.*key shapes, while keys with/remain outside the route. - Preview accepts only a boolean
draft; invalid values returndraft: must_be_boolean, anddraft: truewithtemplate_versionreturnsdraft: conflicts_with_template_version. -
draft: truepreviews the saved draft after at least one version exists and returnspublished: falseandtemplate_version: null, with no database writes or queue work. - Preview without
draft: truepreserves current version resolution and remains byte-for-byte equal to dry-run rendering for the same source and context. -
markdown_layout_contextis editable on the draft, defaults tofalse, rejects non-booleans withmust_be_boolean, is copied into each immutable version, and is returned by template and version APIs. - With the option off, existing clients and all raw HTML/text templates keep their current HTML and plaintext rendering.
- With the option on for a Markdown template, valid
footer_note,verify_email_url, andunsubscribe_urlrender in the client HTML layout in the existing order and are safely escaped. - The same opted-in render produces AISHL plaintext byte-for-byte equal to the reviewed legacy fixture, including Markdown normalization, brand name, footer note, verification action, and unsubscribe action.
- Non-string, over-length, or non-HTTP(S) layout values return field-level validation errors before any contact, message, event, or queue work; unrelated context keys remain available only to the subject/body template.
- Preview, dry-run, normal send, and recipient-list send use the snapshotted option and produce the same fields for the same template version and context; workers and retries deliver the stored rendered fields unchanged.
- API/OpenAPI documentation describes the new request and response contract and dotted template keys.
- Focused tests and the repository test/lint gates pass without AWS credentials or a live send.
Test Notes
- Unit/service tests: draft versus published source resolution; option snapshot immutability; validated layout allowlist; HTML escaping; URL rejection; exact AISHL plaintext fixture; default-off and raw-template behavior.
- API/view tests: dotted-key detail/upsert, publish, versions, preview, and mocked test-send;
draft: true; invalid/non-booleandraft; mutual exclusion withtemplate_version; client isolation; option round trip in list/detail/version payloads. - Pipeline tests: preview equals dry-run; mocked durable and recipient-list paths render the same published version; retry and worker paths deliver the stored fields unchanged; invalid layout context creates no rows and enqueues nothing.
- LocalStack/mocked AWS tests: no LocalStack or real AWS needed; sender/queue boundaries stay mocked.
- UI/screenshot checks: not applicable; this is an authenticated API and rendering-service change.
Blocked by: None
- 主要言語
- Python
- スター
- 0
- フォーク
- 0
- 平均マージ
- 8時間 34分
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DataTalksClub/relay のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
DataTalksClub/relay#48 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
DataTalksClub/relay#42 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
DataTalksClub/relay#41 · コメント 9 件 ·
メンテナーはふだん 1 日以内に返信
-
community-base enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
DataTalksClub/relay#39 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
community-base enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
DataTalksClub/relay#37 · コメント 15 件 ·
メンテナーはふだん 1 日以内に返信
DataTalksClub/relay の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
glossyio/traffic-monitor#264 ·
メンテナーはふだん 1 日以内に返信
-
Add self-hostオープン
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
Atarity/deploy-your-own-saas#102 ·
-
[Bug]: RDFlex silently drops the covariate adjustment when the outcome or treatment column is integer-typed対応中かも @vrjdev が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
DoubleML/doubleml-for-py#424 ·
メンテナーはふだん 1 日以内に返信
-
agentic-dmx docs enhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
521xueweihan/HelloGitHub#4150 ·