Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,8 @@ def _require_transactional_email_flag(self) -> None:
summary="Make a template transactional",
description=(
"Make this template sendable over the transactional email API. This creates the workflow that sends it, "
"with its own metrics, run history and versions. Calling it again on a transactional template changes "
"with its own metrics, run history and versions. This can't be undone: the template stays transactional. "
"Transactional sends ignore marketing opt-outs. Calling it again on a transactional template changes "
"nothing."
),
parameters=[TEMPLATE_ID_PARAMETER],
Expand Down
2 changes: 1 addition & 1 deletion products/messaging/frontend/generated/api.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion products/messaging/frontend/generated/api.zod.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function MakeTransactionalPrompt(props: MessageTemplateSceneLogicProps):
Your edits save as a draft. Publishing updates the live email, and each publish keeps a version.
</li>
<li>Transactional emails ignore marketing opt-outs, so don't use them for marketing.</li>
<li>You can't undo this. The template stays transactional.</li>
</ul>
<div>
<LemonButton
Expand Down
30 changes: 30 additions & 0 deletions products/workflows/mcp/email_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,36 @@ tools:
- content
- created_by
- draft_content
workflows-make-email-template-transactional:
operation: messaging_templates_make_transactional_create
enabled: true
scopes:
- hog_flow:write
annotations:
readOnly: false
destructive: true
idempotent: true
enrich_url: '{id}'
title: Make email template transactional
description: >
Make an email template sendable from code with one API call, for emails a person triggers such as password
resets, receipts and sign-in codes. This is one-way: the template can't be made non-transactional again.
Transactional sends ignore marketing opt-outs, so never use this for marketing email. The template needs a
subject and a body, and the project needs a verified email sender (pass from_integration_id to pick one,
otherwise the project's default sender is used). Requires human typed confirmation. The response has
transactional_hog_flow_id, the workflow that sends the email. Share the template's _posthogUrl so the user
can review and publish it.
feature_flag: workflows-transactional-email-api
response:
exclude:
- content
- draft_content
- created_by
confirmed_action:
message: >
About to make email template '{id}' transactional. This can't be undone, and its sends will ignore
marketing opt-outs. Reply 'confirm' to proceed.
action_label: make email template transactional
workflows-patch-email-template:
operation: messaging_templates_design_partial_update
enabled: true
Expand Down
31 changes: 31 additions & 0 deletions services/mcp/schema/generated-tool-definitions.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions services/mcp/schema/tool-definitions-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -17192,6 +17192,37 @@
"readOnlyHint": true
}
},
"workflows-make-email-template-transactional-execute": {
"description": "Step 2 of 2 for make email template transactional. Verifies the confirmation_hash from -prepare and the literal \"confirm\" string typed by the user, then performs the action. ONLY call this after the user has explicitly typed \"confirm\" in chat. Original action: Make an email template sendable from code with one API call, for emails a person triggers such as password resets, receipts and sign-in codes. This is one-way: the template can't be made non-transactional again. Transactional sends ignore marketing opt-outs, so never use this for marketing email. The template needs a subject and a body, and the project needs a verified email sender (pass from_integration_id to pick one, otherwise the project's default sender is used). Requires human typed confirmation. The response has transactional_hog_flow_id, the workflow that sends the email. Share the template's _posthogUrl so the user can review and publish it.",
"category": "Workflows",
"feature": "workflows",
"summary": "Make email template transactional (execute)",
"title": "Make email template transactional (execute)",
"required_scopes": ["hog_flow:write"],
"api_operations": ["POST /api/projects/{project_id}/messaging_templates/{id}/make_transactional/"],
"annotations": {
"destructiveHint": true,
"idempotentHint": true,
"openWorldHint": true,
"readOnlyHint": false
},
"feature_flag": "workflows-transactional-email-api"
},
"workflows-make-email-template-transactional-prepare": {
"description": "Step 1 of 2 for make email template transactional. Validates the arguments and returns a signed confirmation_hash plus a message to surface to the user. The user must reply with the literal word \"confirm\" before you call the matching -execute tool with the hash. Original action: Make an email template sendable from code with one API call, for emails a person triggers such as password resets, receipts and sign-in codes. This is one-way: the template can't be made non-transactional again. Transactional sends ignore marketing opt-outs, so never use this for marketing email. The template needs a subject and a body, and the project needs a verified email sender (pass from_integration_id to pick one, otherwise the project's default sender is used). Requires human typed confirmation. The response has transactional_hog_flow_id, the workflow that sends the email. Share the template's _posthogUrl so the user can review and publish it.",
"category": "Workflows",
"feature": "workflows",
"summary": "Make email template transactional (prepare)",
"title": "Make email template transactional (prepare)",
"required_scopes": ["hog_flow:write"],
"annotations": {
"destructiveHint": false,
"idempotentHint": true,
"openWorldHint": true,
"readOnlyHint": true
},
"feature_flag": "workflows-transactional-email-api"
},
"workflows-patch-action-email": {
"description": "Surgically edit the email inside one function_email step - the fastest path for copy tweaks and design changes on a workflow email. Use operations (the same design ops as workflows-patch-email-template, addressing blocks by id from the step's config.inputs.email.value.design) to edit the design, and email_patch to change subject, preheader, text, or recipients. After design ops the HTML is re-rendered server-side, so the sent email always matches the design. Edits apply atomically: an invalid batch changes nothing. On an active workflow, edits stage a draft (composing with any staged graph edits) and nothing reaches real people until workflows-publish. The full updated workflow is returned. Prefer this over workflows-patch-graph update_action for email content - it's smaller to send and keeps design and HTML in sync. For library templates use workflows-patch-email-template instead.",
"category": "Workflows",
Expand Down
24 changes: 23 additions & 1 deletion services/mcp/src/generated/email_templates/api.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions services/mcp/src/tools/generated/email_templates.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading