Skip to main content
Version: 1.24

Receipt Templates

A receipt template controls what a receipt PDF looks like: the layout, the wording, the images, and which details are filled in for each donor.

This article explains how to create and edit templates, use the template editor, preview your work, and put a template into use.

What a Template Is​

A template is a web page (HTML) containing merge fields: placeholders such as {!dryad__Receipt__c.dryad__Donor_Name__c} that are replaced with values from the receipt when its PDF is created.

You don't need to know HTML to build one. The template editor works like a word processor, and inserts merge fields and other elements for you.

  • Templates are stored as Receipt Template records.
  • You usually need one template per receipt type (Donation, Acknowledgment, Giving Summary) per language (English, French). Two sample templates, in English and French, are created when the app is installed.
  • Which template a receipt uses is decided by the gift, its Receipting Account and Receipt Settings. This is explained in the Templates section of the Receipt Settings article.
  • Templates control the PDF only. The body of a receipt email is a standard Salesforce email template, set separately.

Creating a Template​

The easiest way to start is to copy one of the sample templates:

  1. Open the Receipt Templates tab and open the sample template closest to what you need.
  2. Click Clone, give the copy a new Description, and save. The template content is copied too.
  3. Edit the content in the template editor on the new record.

To start from a blank page instead, click New on the Receipt Templates tab. Filename is already filled in with the same filename the sample templates use; change it if you need to.

Template Fields​

FieldWhat It Does
Receipt Template #Assigned automatically (for example RT-00003).
DescriptionThe name people see when choosing a template, for example "Donation Receipt EN 2026". Make it descriptive: template pick lists show the number and description together.
Filename

The name of each PDF file, without ".pdf". It can contain merge fields. New templates and the samples use:

Receipt {!dryad__Receipt__c.dryad__Receipt_Name__c} {!dryad__Receipt__c.dryad__Calculated_Issue_Date__c}

which names each file "Receipt", then the receipt number, then the issue date in your Date Format setting. Any "/" in the name is replaced with "-" (so 26/10/2026 becomes 26-10-2026), and spaces at the start and end are removed. Edit it in the template editor to insert merge fields from a list; see Filename below.

Page SizeLetter, Legal or A4. Defaults to Letter when blank.
Page Margin (px)The margin around every page, in pixels. Defaults to 50 when blank.
ActiveOnly active templates appear when you choose a template in Settings, on a Receipting Account or on a gift. Deactivating a template does not change records that already use it. A template that is still in use can't always be deactivated or deleted; see Deactivating or Deleting a Template below.
Validation IssuesRead-only. Filled in each time you click Save in the template editor: the problems found in the template, one per line, or "No issues found." See Checks When You Save below.

The Template Editor​

The editor is on the Receipt Template record page. Its toolbar is grouped as follows.

GroupButtons
ActionsUndo and Redo.
FontParagraph format (normal text or headings), font (Arial, Helvetica, Times or Courier) and font size (8 to 32).
TextBold, italic, underline, alignment, numbered and bulleted lists, text colour, special characters (including French accented letters), clear formatting.
Layout
  • Page Break: starts a new page in the PDF.
  • Insert Footer: adds a footer block (shown in green while editing).
  • The Insert Table button, the Insert Link button and the Insert Horizontal Line button (thin, thick or dashed).
ImagesThe Insert Logo button, the Insert Signature button (with or without a signature line) and the Insert Image button.
MergeThe Insert Receipt Field button, the Insert Receipt Item Field button and the Insert Watermark button.
Help (?)The Open Help button opens this article in a new browser tab.
Code View (</>)Shows the template as HTML, for precise edits or pasting HTML.

The Preview, Preview with Id and Save buttons are at the bottom right of the editor.

Check Validation Issues after every save

Each time you click Save, the editor checks the template and lists any problems in Validation Issues. Fix warnings before you use the template on receipts. Changes made outside the editor aren't checked. See Checks When You Save.

If the Editor Doesn't Appear​

If the editor area on the Receipt Template page is blank, or shows a message such as "refused to connect", your org's security settings are blocking it.

The editor is a Visualforce page shown inside the record page, and Salesforce's clickjack protection can stop it from loading there. To allow it, an administrator adds your org's Lightning domain as a trusted domain:

  1. In Setup, enter Session Settings in the Quick Find box and open it.
  2. Under Trusted Domains for Inline Frames, click Add Domain.
  3. In Domain, enter your org's Lightning domain. The easiest way to get it is to copy the start of the web address of the Receipt Template page, up to and including .com. For example:
    • Production: https://yourdomain.lightning.force.com
    • Sandbox: https://yourdomain--sandboxname.sandbox.lightning.force.com
  4. In IFrame Type, choose Visualforce Pages, then save.
  5. Refresh the Receipt Template page.

Each sandbox has its own domain, so add the setting in each sandbox where the editor doesn't appear. Adding a trusted domain is safer than turning clickjack protection off, which affects every page in your org.

Filename​

The Filename box above the editor sets the name of each PDF file. Place the cursor where a value should go and choose a field from the Insert Receipt Field button next to the box.

It lists the same Receipt fields as the toolbar button. Clicking Save saves the filename together with the template content, and checks both.

One Place to Edit​

Filename can also be changed on the record's details, but changes made there aren't checked. If you edit it in both places, the last one saved wins.

Building Blocks​

Merge Fields​

Place the cursor where the value should appear and choose a field from the Insert Receipt Field button. The list shows the Receipt fields you have access to, by API name. Useful ones include:

To showUse
Receipt numberdryad__Receipt_Name__c
Donor name, first name, addressdryad__Donor_Name__c, dryad__Donor_First_Name__c, dryad__Donor_Address_Multiline__c
Gift and receipt amountsdryad__Donation_Amount__c, dryad__Receipted_Amount__c
Dates, in your Date Format settingdryad__Calculated_Issue_Date__c, dryad__Calculated_Payment_Date__c
Charity detailsdryad__Charity_Name__c, dryad__Charity_Registration_Num__c, dryad__Charity_Address__c, dryad__Location_Issued__c
Signerdryad__Authorized_Name__c, dryad__Authorized_Title__c
Ready-made lines that appear only when they applydryad__Replacement_Text_EN__c, dryad__Voided_Text_EN__c, dryad__Advantage_Text_EN__c (and their _FR versions)

To show your own custom fields, or text that appears only when a field has a value, see the Field Mapping article.

Logo and Signature​

Always add these with the Insert Logo button and the Insert Signature button, not with Insert Image. In the editor they show the logo and signature from Receipt Settings.

When you save, they are linked to the receipt's own Charity Logo URL and Authorized Signature URL. That means each receipt shows the right logo and signature, including receipts issued by a Receipting Account.

To resize one, click it and use the image size option. The images themselves are set on the Charity Information page of Settings (or on the Receipting Account), not in the template.

If you click the logo or signature and use the Replace button (see Other Images), it becomes a regular image with the URL you entered.

Every receipt from that template then shows that image, and it no longer follows Receipt Settings or the Receipting Account. To link it again, delete it and add it with the Insert Logo button or the Insert Signature button.

Other Images​

The Insert Image button opens an image picker where you can upload a PNG, JPG or GIF file, or choose one uploaded earlier.

Uploaded images are shared with all users so every template can use them, and so the PDF can include them no matter who creates it.

Each inserted image points to that exact file version. Uploading a new version of the old file doesn't update templates.

To change an image and keep its size and style, click it, click Replace, paste the new image's URL and click Insert.

The URL must start with https:// and be reachable without signing in, because the PDF is created without access to other websites' logins.

A private or http:// image prints blank. To use a different file from Salesforce Files instead, delete the image and add the new one with Insert Image, which shares it with all users.

Tables and Columns​

Use tables to place things side by side, such as the logo on the left and the receipt details on the right. The sample templates are built this way.

  • Tables are full width by default, and their borders don't print. While editing, cells show a dotted outline to help you see them.
  • To set column widths, select a cell, choose the table cell style option and pick a width from "1/12" to "11/12". The widths in each row should add up to 12, for example 6 + 6 for two equal columns or 7 + 5.
  • The Page Break button starts a new page in the PDF. It is shown as a "Page Break" line in the editor.
  • The Insert Footer button adds a block that is printed at the bottom of each page, for example your charity's address and website or the CRA link. Replace the placeholder text in the green area with your content.

Watermarks​

The Insert Watermark button adds a stamp across the receipt, at the spot where you insert it. Each stamp comes in English (EN), French (FR) or both (EN/FR).

OptionWhen It Prints
Duplicate (EN), (FR), (EN/FR)On every receipt created from the template. Use it in a template you keep for reissuing copies of receipts.
Void (EN), (FR), (EN/FR)Only when the receipt's status is "Voided". On other receipts it prints nothing.
  • The sample templates include the Void stamp at the top of the official receipt section, which is where the stamp appears.
  • A template can contain both stamps. A voided receipt then shows both.

List of Gifts​

Consolidated receipts and giving summaries can list each gift. Click Insert Receipt Item Field, choose the columns you want, and the editor inserts a table with a header row and one row of item merge fields, wrapped in {{Receipt_Items_Start}} and {{Receipt_Items_End}} markers.

When the PDF is created, that row is repeated for each gift. Don't delete the markers.

The Field Mapping article explains how to add more columns, such as a custom field from the gift.

Preview and Save​

ButtonWhat It Does
PreviewOpens a preview in a new browser tab, filled in with the most recently created receipt in your org. Unsaved changes are included.
Preview with IdAsks for a Receipt record ID (the 15- or 18-character ID in the receipt's web address) and previews with that receipt. Use it to test specific cases: a consolidated receipt with several gifts, a voided receipt, a French donor, or a receipt with an advantage.
SaveChecks the template, then saves it unless a problem would break receipts. See Checks When You Save.

Your browser must allow pop-ups from Salesforce for the preview to open.

The Preview Is Close, but Not Exact​

The preview is shown as a web page, while receipts are produced by Salesforce's PDF engine, which supports fewer formatting options. Page breaks, the footer position and some spacing only show correctly in the PDF.

Before using a new template for real, create a test receipt and click Create PDF on it to check the actual file.

Checks When You Save​

When you click Save, the editor checks the template. A message tells you the outcome, and the problems found are listed in the template's Validation Issues field, which updates on the record page straight away.

MessageWhat Happened
"Content saved successfully!"No problems were found. Validation Issues shows "No issues found."
"Template saved with warnings. See Validation Issues."The template was saved, but something may need your attention.
"Template not saved. See Validation Issues."A problem would break receipts, so neither the template content nor the filename was saved. The last saved version is kept. Fix the problems and save again.

These problems stop the save:

  • Unclosed or unmatched HTML tags typed in Code View. Tags HTML allows to stay open, such as paragraphs, list items and table cells, aren't reported.
  • Merge fields that don't exist on Receipt or Receipt Item, including fields reached through a lookup, for example "The merge field {!dryad__Receipt__c.Bogus__c} was not found on Receipt."
  • Broken merge fields: a merge field with formatting applied to part of it, or missing its closing }.
  • Receipt Item fields outside the list of gifts: they must be in a table row between {{Receipt_Items_Start}} and {{Receipt_Items_End}}.
  • Unknown {{…}} tags. Only the list of gifts markers and the watermark tags are allowed.
  • Content that is too long: more than 131,072 characters.
  • A blank filename, shown as "Filename: Enter a filename."

The filename is checked for merge fields in the same way as the content. Its problems start with "Filename:", for example "Filename: The merge field {!dryad__Receipt__c.Bogus__c} was not found on Receipt."

These only warn, and the template is saved:

  • Size. The template and its images are larger than the Receipt Template Threshold setting (50 KB by default). The warning shows the total size and lists the three largest images on a new line. Images from Salesforce Files and static resources, images pasted into the template, and the logo and signature from Receipt Settings are counted. Watermarks and images from other websites aren't. See Receipt Template Threshold in the Receipt Settings article.
  • Merge fields on other objects, such as {!Organization.Name}, which the editor can't verify.
  • Elements the PDF ignores, such as scripts, frames, forms and videos.

Only the template editor checks. Changes made on the standard edit page, with data loads or through the API aren't checked, and Validation Issues isn't updated by them.

Putting a Template into Use​

A template is used when it is chosen in one of these places:

  • Settings > Templates: the default template for each receipt type and language.
  • Receipting Account: templates for receipts issued by that charity, if you use Receipting Accounts.
  • The gift: the Receipt Template field on a Recurring Donation, Opportunity or Payment, for a one-off override.

The Receipt Settings article explains the order in which these are checked.

What Changes When You Edit a Template​

  • Each receipt remembers its template. The template is recorded on the Receipt when the receipt is created. Changing the default template in Settings affects new receipts only.
  • Existing PDFs don't change. A PDF is a file created at a point in time. Editing the template changes PDFs created from then on.
  • Regenerating uses the current version. If you click Create PDF on an existing receipt, the new PDF uses the template's current content. Keep this in mind before regenerating receipts from previous years after a redesign.
Make big template changes on a copy

Clone the template, test the copy, then select it in Receipt Settings. The original stays available for reissues.

Deactivating or Deleting a Template​

To retire a template, untick Active. It is then no longer offered when you choose a template. The app stops you from deactivating or deleting a template that is still needed:

Where the template is selectedDeactivateDelete
Receipt Settings (any template on the Templates tab)BlockedBlocked
A Recurring Donation (open or closed)BlockedBlocked
An Account (Receipt Template - Donation (EN) or (FR))BlockedBlocked
An Opportunity or PaymentAllowedBlocked
NowhereAllowedAllowed
  • Gifts are history. A template used on old Opportunities or Payments can be deactivated, so a template used years ago doesn't stay active forever. Those gifts keep their template, can still be edited, and a reissued receipt uses it. To reissue with a different template, change Receipt Template on the gift first.
  • Deleting is stricter because it can't be undone: Salesforce would clear the template from every record that uses it.
  • Records you can't see still count. The check includes records hidden from you by sharing.
  • Change the records, then try again. When the change is blocked, choose another template in Settings or on the records named in the message, then deactivate or delete the template.

One Place at a Time​

When a template is used in several places, the message names only one of them. Fix it and try again; the next message names the next place.

Layout Limits and Tips​

  • Use tables for layout. Salesforce's PDF engine supports only older web formatting (CSS 2.1). Side-by-side columns built with tables work reliably; modern layout techniques such as flexbox or grid are ignored.
  • Stick to the four fonts. Arial, Helvetica, Times and Courier are reliable in the PDF. Other fonts may be replaced.
  • Pasted text is plain text. Formatting from Word or a web page is removed when you paste. Apply formatting in the editor afterwards.
  • Merge field spelling matters. If you type a merge field yourself, it must match exactly, including the dryad__ prefixes. Insert fields from the toolbar where you can. The editor checks merge fields when you save.
  • Bilingual receipts. Keep separate English and French templates, and assign them in Settings. The donor's receipt language picks between them. For a single bilingual layout, put both languages in one template and assign it to both.

Troubleshooting​

SymptomCheck
The template editor is blank, or shows "refused to connect"Your org's clickjack protection is blocking the editor. Add your org's Lightning domain as a trusted domain; see If the Editor Doesn't Appear.
A merge field prints blankThe receipt may have no value in that field, or the person creating the PDF can't see the field (field-level security). Check the spelling in Code View.
A merge field prints as text, for example {!dryad__Receipt__c.Donor_Name__c}The field name is misspelled or missing its dryad__ prefix. Remove it and insert it again from the Insert Receipt Field button.
The wrong logo or signature appears, or the same one on every Receipting AccountThe image was added with Insert Image instead of Insert Logo or Insert Signature, or it was changed with Replace. Delete it and insert it with the correct button.
An image is missing from the PDFInsert it again with Insert Image so it is shared with all users. Images copied from other websites or pasted in may not be reachable when the PDF is created.
The list of gifts shows only one row, or noneCheck that the item row contains item merge fields and sits between the {{Receipt_Items_Start}} and {{Receipt_Items_End}} markers. Single (one-gift) receipts have no items to list.
"Template not saved. See Validation Issues."Read the template's Validation Issues field, fix each problem listed, and save again. See Checks When You Save.
A Validation Issues line starts with "Filename:"The problem is in the Filename box above the editor, not in the template content. Fix it there, or insert the field again from the Insert Receipt Field button next to the box.
The PDF file name is the Filename text followed by the receipt number and today's date, with the merge fields left inFilename contains a merge field that couldn't be filled in, usually because of a typo made on the record's details. Correct it in the template editor, which checks it when you save.
"The content has … characters. It must have 131,072 characters or fewer."The template is too long. Remove pasted images (use Insert Image instead) or unneeded formatting, which you can find in Code View.
"The merge field … is broken."Formatting was applied to part of the merge field, or its closing } is missing. Delete it and insert it again from the toolbar, without formatting.
"The template and its images are … KB."The template is larger than the Receipt Template Threshold setting. Use smaller images, or replace images pasted into the template with Insert Image.
The template isn't offered in Settings or on a giftCheck that Active is ticked.
"DUPLICATE" prints on every receiptThe template contains a Duplicate watermark, which always prints. Remove it, or keep it only in a separate template used for reissued copies.
"Select an active receipt template." when saving a Recurring Donation or AccountIts Receipt Template field points to an inactive template. Choose an active template, or reactivate the template.
"This receipt template is in use. Change the template in Receipt Settings before continuing."The template is selected on the Templates tab of Settings. Choose another template there first.
"This receipt template is selected on one or more …"The template is used on the records named in the message (the name follows your org's object labels). Change the template on those records, then try again. See Deactivating or Deleting a Template.
Changes don't show on a receiptDid you click Save? Is the receipt using this template (check its Receipt Template field)? Existing PDFs don't update; click Create PDF to make a new one.
Clicking Open Help does nothingYour browser blocked the new tab. Allow pop-ups for your Salesforce org and click it again.
The layout looks right in Preview but not in the PDFThe PDF engine supports less formatting than the browser. Use tables and column widths instead of other positioning, and test with Create PDF.