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;
templateName?: string | undefined;Template name segment in backend route.
Return value
›template_name?: string | undefined;
template_name?: string | undefined;Template identifier.
›template_data?: string | undefined;
template_data?: string | undefined;Template body/content.
›template_from?: string | undefined;
template_from?: string | undefined;From address.
›template_reply_to?: string | undefined;
template_reply_to?: string | undefined;Reply-to address when configured.
›template_subject?: string | undefined;
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.