Document Templates

A Document Template is a reusable design for generating PDF documents from DonorPoint data. They are used anywhere DonorPoint needs to produce a formatted document: event tickets, vouchers, tax receipts, pledge statements, billing invoices, membership cards, and acknowledgement letters.

Document Templates are the primary topic for all document generation in DonorPoint. Other sections link here:

  • Attachments — attaching a template to an Item so PDFs are sent with receipt emails
  • Ticketing — generating event tickets per registrant
  • Document Generation — generating documents from transactions in bulk or on demand

Where to Find Document Templates

Customization & Configuration → Document Templates in the left sidebar.

Document Template Fields

Field Description
Name Internal name used to identify the template in the admin
Content The document body — rich-text XHTML editor
HTML Header Optional HTML head content for additional CSS or font declarations
Width Page width in inches
Height Page height in inches
Margins Page margins (top, right, bottom, left)
Paging Type How pages are handled when content overflows: single page, or multi-page
Setup Script A script that runs before the document is rendered, used to prepare data or set variables
Account The account this template belongs to

Content

The document body is written in XHTML and edited using the rich-text editor with source view. The full DonorPoint merge tag system is available — use #{field} expressions to insert data from the transaction, contact, order items, and custom fields.

Common merge fields in document content:

Context Example
Contact name #{contact.firstName} #{contact.lastName}
Transaction date #{purchaseOrder.orderReceived}
Transaction amount #{purchaseOrder.amount}
Item name #{orderItem.orderableItem.name}
Custom field value #{orderItem.get('TicketNumber').value}
Fund name #{orderItem.fund.name}
Organization #{organization.name}

Page Dimensions

Templates are sized in inches. Common sizes:

Use Case Width Height
Letter — portrait 8.5 11
Letter — landscape 11 8.5
Event ticket 5.5 2
Membership card 3.375 2.125
Half-page receipt 8.5 5.5

Setup Script

The Setup Script runs before the document content is rendered. Use it to:

  • Calculate values to use in the document (e.g., compute a balance due)
  • Query related records not directly in context
  • Set variables referenced in the document body

The script has access to the same context variables as other DonorPoint scripts — see Scripting Guide for the full reference.

Reuse

A single Document Template can be used in multiple places — as an attachment on multiple Items, as the ticket template for multiple Event Packages, or in multiple bulk generation workflows. Changing the template updates all uses.

System Templates

Some Document Templates are marked as System templates. These are provided by DonorPoint and cannot be deleted, but they can be duplicated and modified to create custom versions.