---
schema_version: "1"
id: 3aff05634ef2e14d9de10cebaa53633156471e004d7415f840117b95b65e2517
title: RenderEmailTemplateError Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_Messaging_RenderEmailTemplateError.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Messaging_RenderEmailTemplateError.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 87ca1180855f23ff55554db81b563d32e3f027573df9cf1240fd1ad242b79ed0
description: Represents an error that the RenderEmailTemplateBodyResult object can contain.Returns the name of the merge field in the error.Returns a message describing the error.Returns the offset within the supplied body text where the error was discovered. If the offset cannot be determined, -1 is returned.Returns a Salesforce API status code.
---
# RenderEmailTemplateError Class

Represents an error that the RenderEmailTemplateBodyResult object can contain.

## Namespace

[Messaging](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Messaging.htm "The Messaging namespace provides classes and methods for Salesforce notifications and email functionality.")

- **[RenderEmailTemplateError Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Messaging_RenderEmailTemplateError.htm#apex_Messaging_RenderEmailTemplateError_methods)**

## RenderEmailTemplateError Methods

The following are methods for RenderEmailTemplateError.

- **[getFieldName()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Messaging_RenderEmailTemplateError.htm#apex_Messaging_RenderEmailTemplateError_getFieldName)**  
    Returns the name of the merge field in the error.
- **[getMessage()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Messaging_RenderEmailTemplateError.htm#apex_Messaging_RenderEmailTemplateError_getMessage)**  
    Returns a message describing the error.
- **[getOffset()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Messaging_RenderEmailTemplateError.htm#apex_Messaging_RenderEmailTemplateError_getOffset)**  
    Returns the offset within the supplied body text where the error was discovered. If the offset cannot be determined, -1 is returned.
- **[getStatusCode()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Messaging_RenderEmailTemplateError.htm#apex_Messaging_RenderEmailTemplateError_getStatusCode)**  
    Returns a Salesforce API status code.

### getFieldName()

Returns the name of the merge field in the error.

#### Signature

public String getFieldName()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### getMessage()

Returns a message describing the error.

#### Signature

public String getMessage()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### getOffset()

Returns the offset within the supplied body text where the error was discovered. If the offset cannot be determined, -1 is returned.

#### Signature

public Integer getOffset()

#### Return Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

### getStatusCode()

Returns a Salesforce API status code.

#### Signature

public System.StatusCode getStatusCode()

#### Return Value

Type: System.StatusCode