fix: transient payload example#2650
Conversation
There was a problem hiding this comment.
Pull request overview
Improves Ory Kratos email/SMS documentation by making the HTTP courier payload and template-type lists track the upstream Kratos source, and by expanding the guidance/examples around transient_payload usage in email templates.
Changes:
- Embed upstream Kratos source snippets via
CodeFromRemotefor the HTTP deliveryctxmodel and template type constants. - Add a new “Events that trigger an email” section + an additional template-variable tab (
verifiable_address_changed). - Add a worked example showing how to pass brand/language via
transient_payloadinto template links, and cross-link it from the “Bring your own UI” guide.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/kratos/emails-sms/05_custom-email-templates.mdx | Adds template-type source embed, event/condition table, clarifications on authoritative fields, and a new transient payload example. |
| docs/kratos/emails-sms/01_sending-emails-smtp.mdx | Adds ctx payload definition and example Jsonnet template as upstream-synced embeds, plus a hand-maintained field table. |
| docs/kratos/bring-your-own-ui/05_custom-ui-basic-integration.mdx | Adds a link pointing readers to the transient payload email-template example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| The following template is the example mailer configuration shipped with Ory Kratos. It maps the most common fields out of `ctx`. | ||
|
|
||
| <CodeFromRemote |
There was a problem hiding this comment.
The code snippet renders without a readable format
There was a problem hiding this comment.
| | `verifiable_address_changed` | A verifiable address on an identity changes; sent to the previous address(es). | Only if the `notify_previous_addresses` hook is enabled. | | ||
| | `stub` | Not sent in production. | Test stub used by the Ory Kratos test suite. It does not correspond to a real email. | | ||
|
|
||
| :::note |
There was a problem hiding this comment.
This note refers to the imported list of template types. Move it to below that section and above this table
There was a problem hiding this comment.
the note refers to the stub Template type which is right above it (last item in the table) - I think its easier to find it if they sit next to each other right?
otherwise you get the note about stub right at the top and then you need to scroll down (and remember) until you get to the entry that the note references.
the note is also only there for completeness sake and most users wont encounter the stub template.
Co-authored-by: unatasha8 <una.cogavin@ory.sh>
Co-authored-by: unatasha8 <una.cogavin@ory.sh>

Related Issue or Design Document
Checklist
If this pull request addresses a security vulnerability,
I confirm that I got approval (please contact security@ory.com) from the maintainers to push the changes.
Further comments