---
schema_version: "1"
id: 0c2d83cc0fdc03cd73b2f22002c15d70efa1b7d5ddb9062d07fe61b969bdb530
title: EmailTemplate
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_tooling/tooling_api_objects_emailtemplate.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_emailtemplate.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 97e848e5491dd3a9ec57f4bb55d349912f0064d25dbb35adc20afa325dc2ffeb
description: Represents a template for an email, mass email, list email, or Sales Engagement email. Supported in first-generation managed packages only.
---
# EmailTemplate

Represents a template for an email, mass email, list email, or Sales Engagement email. Supported in first-generation managed packages only.

This object is available in API version 32.0 and later.

## Supported SOAP Calls

create(), getDeleted(), getUpdated(), query(), retrieve(), search()

## Supported REST HTTP Methods

DELETE, GET, PATCH, POST

## Fields

| Field | Details |
| --- | --- |
| ApiVersion | 
Type

double

Properties

Filter, Nillable, Sort

Description

The API version if this is a Visualforce email template. Every Visualforce email template has an API version specified at creation.



 |
| Description | 

Type

string

Properties

Filter, Nillable, Sort

Description

The email template description. This can be useful to describe the reason for creating the template or its intended use.



 |
| FullName | 

Type

string

Properties

Create, Group, Nillable

Description

The unique name used as the template identifier for API access. The fullName can contain only underscores and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.

Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.



 |
| ManageableState | 

Type

ManageableState enumerated list

Properties

Filter, Group, Nillable, Restricted picklist, Sort

Description

Indicates the manageable state of the specified component that is contained in a package:

- beta
- deleted
- deprecated
- deprecatedEditable
- installed
- installedEditable
- released
- unmanaged





 |
| Metadata | 

Type

EmailTemplateMetadata

Properties

Create, Nillable, Update

Description

Email template metadata.

Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.



 |
| Name | 

Type

string

Properties

Filter, Group, idLookup, Sort

Description

The email template name.



 |
| NamespacePrefix | 

Type

string

Properties

Filter, Group, Nillable, Sort

Description

A unique string to distinguish this template from any others. For example, if this template is being using by a flow, use the NamespacePrefix to uniquely identify the templates in multiple flow instances.



 |
| RelatedEntityType | 

Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort

Description

When UIType is 2 (Lightning Experience) or 3 (Lightning ExperienceSample), RelatedEntityType indicates which entities this template can be used with. Valid values are the entity API name: "Account" for account, "Contact" for contact, "Opportunity" for opportunity, "Lead" for lead, and so on. The value can be any entity the user has read access to (including custom entities) but not virtual entities, setup entities, or platform entities.

No restrictions exist at the schema level.



 |
| Subject | 

Type

string

Properties

Group, Nillable, Sort

Description

The email subject.

The limit is 1,000 characters for Lightning email templates and 230 characters for Classic email templates.



 |
| UIType | 

Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort

Description

Indicates the user interface where this template is usable. Valid values are: 1 (Salesforce Classic), 2 (Lightning Experience), and 3 (Lightning Experience Sample).



 |