Letterhead defines reusable branding and formatting for Classic HTML email templates: logos, page and body colors, header and footer regions, and separator lines. An EmailTemplate references the letterhead for formatting; the letterhead does not define the email body or sending logic.
This is the Classic letterhead metadata type, not the EnhancedLetterhead data object. Retrieving or deploying one does not retrieve or deploy the other.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The internal metadata identity inherited from Metadata. It is distinct from name and identifies the component for metadata operations. |
name |
Required. The name of the letterhead, separate from its internal metadata identity. |
available |
Required boolean. true makes the letterhead available for use, such as in an email template; false makes it unavailable. |
backgroundColor |
Required. The page background color in hexadecimal format, such as #FF6600. The same element name inside a header or footer controls that region's background. |
bodyColor |
Required. The body color in hexadecimal format. |
header, footer
|
Required nested regions. Each requires its own backgroundColor and height, even when it has no logo. |
height inside header or footer
|
Required integer controlling the region's height. It is not a dashboard component collection. |
horizontalAlignment |
Optional header/footer alignment. Allowed values: None, Left, Center, Right. |
verticalAlignment |
Optional header/footer alignment. Allowed values: None, Top, Middle, Bottom. |
logo |
Optional reference inside a header or footer to a Document, using a folder-qualified name such as MyFolder/MyDocument.gif. It stores a reference, not image content. |
topLine, middleLine, bottomLine
|
Required nested separator-line configurations. Each requires a hexadecimal color and an integer height; these are not scalar line-style choices. |
Behavior and Constraints
A fully configured letterhead can still be unavailable when available is false. This flag controls availability; it does not identify which email templates reference the letterhead or establish whether a recipient can access its logo images.
Header and footer configuration remains required when no logo is supplied. Omitting logo, horizontalAlignment, or verticalAlignment does not make the region's backgroundColor or height optional.
LetterheadHeaderFooter and LetterheadLine describe nested configuration within the letterhead. They are not separate components to retrieve or deploy. Each of the three separator lines contains its own required color and height.
Logo visibility is a separate check from letterhead availability. Community guidance identifies the logo Document's "Externally Available Image" setting as necessary for non-Salesforce recipients. The absence of the Documents tab in Lightning Experience does not remove the dependency on Document.
Deployment and Retrieval
In a Metadata API package, letterheads use the .letter file suffix and reside in the letterhead directory of the corresponding package directory.
Letterhead does not support the * wildcard in package.xml, the manifest that selects components for deployment or retrieval. List each letterhead member explicitly under the Letterhead type, using its internal metadata identity, fullName, rather than assuming that the name element is interchangeable with it.
The dependency chain is EmailTemplate to Letterhead to Document. The letterhead file contains the logo reference, not the image bytes. The Documents actually named by header and footer determine the image dependencies; migration scope also depends on whether those Documents already exist in the destination.
This relationship does not mean that every image must be redeployed, nor does it establish a universal deployment sequence. A community change-set workaround involving joint deployment and template recreation is described under Reported Issues; it is not a general requirement to delete destination templates.
Retrieving this type retrieves the Classic letterhead definition. Do not treat it as retrieval of Enhanced Letterhead or use the two as interchangeable deployment identities.
Relationships
For impact analysis, follow the templates that reference this letterhead and the Documents named by its header and footer logos. A possible schema relationship does not, by itself, establish actual use by a particular template or image.
References
-
Document:logo, nested underheaderorfooter.
Referenced By
-
EmailTemplate:letterhead.
Documentation Inconsistencies
The published Letterhead field table labels bottomLine as an enumeration, even though its definition and XML example use a nested structure. Supply child elements color and height, as with topLine and middleLine, rather than an enumeration value.
The header/footer field table also labels height as DashboardComponent[]. Header and footer heights are exposed as integers, consistent with the numeric metadata example. Do not interpret this table entry as a relationship to dashboard components.
Reported Issues
-
Logos can appear internally but be missing for external recipients. Guidance updated in 2019 says that logo Documents must be marked "Externally Available Image" for non-Salesforce recipients. It also explains that the missing Documents tab in Lightning Experience does not mean Documents are no longer used by email templates. Check Document visibility separately from
available. Logo storage and external visibility discussion. -
A Classic letterhead retrieval should not be expected to retrieve Enhanced Letterhead. A 2022 discussion distinguishes
Letterheadmetadata fromEnhancedLetterheadobject data. The distinction changes which asset must be migrated; it does not make the two interchangeable names for the same component. Enhanced Letterhead retrieval discussion. -
Manually combining runtime fields can fail to produce complete email HTML. In a discussion updated in 2017, developers described
EmailTemplate.HtmlValueandBrandTemplate.Valueas separate pieces and reported problems combining them or treating either as a complete rendered message. The discussion recommendsMessaging.renderStoredEmailTemplate(templateId, whoId, whatId)for stored-template rendering instead of manual assembly. This is Apex runtime guidance, not a different serialization format forLetterhead. Apex letterhead rendering discussion. - Successful previews and test emails did not guarantee that Apex-sent messages displayed the images. A 2024 report described missing header and footer images when sending through Apex, despite images appearing in preview and test emails. A 2025 reply proposed deploying the email template, letterhead, and referenced Documents together in one change set, recreating destination templates if they were already present, and checking header/footer heights for zero values. This is a reported workaround, not a universal requirement to delete templates, redeploy all images, or follow a fixed deployment sequence. Missing images after Apex sending discussion.
- Pasted HTML can appear as text in the Classic letterhead template editor. A 2020 report concerned an HTML button snippet entered into a template body, not a failure of the letterhead metadata. The answer recommended using the rich-text editor, including a linked image for a button, or using a custom template without letterhead when directly authored HTML is needed. Classic template HTML editing discussion.
Common Questions
Can I use a wildcard to retrieve all Letterheads?
No. Letterhead does not support * in package.xml. Enumerate each member explicitly using its fullName.
Does retrieving Letterhead also retrieve Enhanced Letterhead?
No. This type represents Classic letterhead metadata. EnhancedLetterhead is a separate data object, not an interchangeable deployment identity.
Why is my letterhead logo missing for external recipients?
Check the referenced Document's "Externally Available Image" setting. Community guidance identifies that setting as necessary for non-Salesforce recipients. Making the letterhead available does not replace the Document visibility check.
Do I need to deploy the logo Document with the letterhead?
The letterhead stores a folder-qualified Document reference, not the image content. Whether a Document needs migration depends on the logo actually referenced and its state in the destination. The relationship alone does not require redeploying every image or impose a fixed sequence.
How do I get complete letterhead email HTML in Apex?
Community guidance recommends Messaging.renderStoredEmailTemplate(templateId, whoId, whatId) rather than manually combining EmailTemplate.HtmlValue and BrandTemplate.Value. Those runtime fields should not be confused with the Letterhead metadata definition.