NewWacht Bench is live — AI-assisted development for Wacht

getEmailTemplate()

Loads the email template by template name from /settings/email-templates/{template_name}.

Usage

The following example shows a basic usage of the backend client from @wacht/nextjs/server.

import { wachtClient } from '@wacht/nextjs/server';export async function getTemplate(templateName: string) {  const client = await wachtClient();  return client.settings.getEmailTemplate(templateName);}

Signature

function getEmailTemplate(  templateName: string,): Promise<EmailTemplate>

Parameters

templateName?: string | undefined;
Template name segment in backend route.

Return value

template_name?: string | undefined;
Template identifier.
template_data?: string | undefined;
Template body/content.
template_from?: string | undefined;
From address.
template_reply_to?: string | undefined;
Reply-to address when configured.
template_subject?: string | undefined;
Template subject line.

Behavior

  • Fetches a single resource by identifier or query context.
  • Use this result as the source of truth before update, replay, or delete flows.

On this page