template_invalid
HTTP status: 422 · Code: template_invalid
An email template failed to parse, names an unknown variable or filter, or is too costly to render.
Why it happens
Section titled “Why it happens”An email template failed to parse, uses a variable or filter that doesn’t exist, or would take too much work to render.
How to fix
Section titled “How to fix”Read the error message for the line, fix the template in the console’s email templates, and use the preview to check it. See Email settings and templates.
Catch it in your code
Section titled “Catch it in your code”Every SDK throws one error type for a failed call. Match on its code, which is always template_invalid for this error, never on the message.
import { ErrorCode, OrvanoError } from '@orvano/js'
try { // your Orvano call} catch (error) { if (error instanceof OrvanoError && error.code === ErrorCode.templateInvalid) { // handle template_invalid } else { throw error }}import 'package:orvano_flutter/orvano_flutter.dart'; // or orvano_dart on a server
try { // your Orvano call} on OrvanoException catch (error) { if (error.code != ErrorCode.templateInvalid) rethrow; // handle template_invalid}using Orvano;
try{ // your Orvano call}catch (OrvanoException error) when (error.Code == ErrorCode.TemplateInvalid){ // handle template_invalid}The error also carries the HTTP status (422), a message, and a request ID. Quote the request ID when you report a problem: the server logs it with the failure. See Errors for how errors work in every SDK, or every error code.