diff --git a/docs/guides/integrate-with-ory-cloud-through-webhooks.mdx b/docs/guides/integrate-with-ory-cloud-through-webhooks.mdx index 14108d9ed..dbd009f1b 100644 --- a/docs/guides/integrate-with-ory-cloud-through-webhooks.mdx +++ b/docs/guides/integrate-with-ory-cloud-through-webhooks.mdx @@ -301,7 +301,7 @@ Use the `ctx` object to access these fields in your Jsonnet template, for exampl ```jsonnet title="./segment_identify.jsonnet" function(ctx) { userId: ctx.identity.id, - customData: ctx.transient_payload.custom_data + customData: ctx.flow.transient_payload.custom_data traits: { email: ctx.identity.traits.email, name: ctx.identity.traits.name, diff --git a/docs/kratos/emails-sms/05_custom-email-templates.mdx b/docs/kratos/emails-sms/05_custom-email-templates.mdx index c351ec4cc..a42501048 100644 --- a/docs/kratos/emails-sms/05_custom-email-templates.mdx +++ b/docs/kratos/emails-sms/05_custom-email-templates.mdx @@ -508,3 +508,41 @@ Since metadata is not validated by Ory Identities, missing entries or unexpected process. If the system encounters errors in the rendering process, Ory Identities uses the default templates. ::: + +### Transient payload in templates + +The transient payload allows you to pass additional data along with certain self-service flows. Transient payloads can be used for +passing temporary information to your email template without storing it permanently. + +The following `example_key` transient payload + +``` +... + traits: { + email: "user@example.com", + }, + transient_payload: { + example_key: "This is an example value" + }, +... +``` + +can be accessed in the email template using `{{index .TransientPayload "example_key"}}` + +```gotmpl + +

Recovery Details

+

To: {{.To}}

+

Recovery URL: {{.RecoveryURL}}

+

Transient Payload: {{index .TransientPayload "example_key"}}

+ +``` + +This results into the following email to be sent to the user. + +```gotmpl +

Recovery Details

+

To: user@example.com

+

Recovery URL: https://example.com/recover

+

Transient Payload: This is an example value

+```