Skip to main content

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. It is written for Salesforce administrators.

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.

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. 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.

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.

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.
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.

Save before you leave. The editor doesn't save automatically. Leaving the page or refreshing it discards unsaved changes.

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.

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. To change an image, upload the new one and insert it again; uploading a new version of the old file doesn't update templates.

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.

Void Watermark​

The Insert Watermark button adds a "VOID" stamp in English, French or both. It appears only when the receipt's status is "Voided"; on other receipts it prints nothing. The samples place it at the top of the official receipt section, which is where the stamp appears.

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.
SaveSaves the template. A template can be up to 32,768 characters of HTML; very long templates, or images pasted directly into the editor, can exceed this.

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.

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 an Opportunity, Payment or Recurring Donation, 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.

Making big changes safely. Clone the template, make your changes on the copy, test it, then switch the setting to the copy. The original stays untouched for reissuing older receipts.

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.
  • 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
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. 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.
"Content must be less than 32768 characters!"The template is too long. Remove pasted images (use Insert Image instead) or unneeded formatting, which you can find in Code View.
The template isn't offered in Settings or on a giftCheck that Active is ticked.
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.
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.