What a dynamic document is
A dynamic document is a Google Doc used as a template. Where the Doc says <<ParentName>>, each recipient’s PDF has their own parent name. Where it says <<Charges>>, the PDF can have a table of that family’s own rows, with a total at the bottom.
It suits letters that look the same for everyone but carry personal facts: a statement, a permission slip, a schedule. Which attachment fits which job is in Which attachment?. If every recipient already has their own finished file, use personal attachments instead. If you need to fill in a fixed PDF form, use PDF forms.
- The Doc is read at send time. Fix a typo in the Google Doc and every later send uses the fixed text. Nothing is frozen in candl.
- One PDF per envelope. A household letter gets one PDF for the family, filled in for the student or household the email is built for.
- The PDF goes in the email as an ordinary attachment, next to any files you uploaded.
Prepare the Google Doc
- Write the letter in Google Docs as you want it printed: letterhead, fonts, margins.
- Type each placeholder as plain text between double angle brackets:
<<ParentName>>. Use a name that says what it is. Letters and numbers are safest. Upper and lower case count, so<<Grade>>and<<grade>>are two tags. - For a table, put its tag, for example
<<Charges>>, alone on its own line. The table takes that line’s place. - Make sure the person who sends the email can open the Doc. candl makes a temporary copy of it for every recipient and throws the copy away after the PDF is made.
A tag you use twice, such as the parent name in the greeting and again in the footer, is one tag: you match it once and it fills in both places. Tags in a header or footer are found too.
<<Charges>> the way you want the table text to look.Attach it to an email
In the Pro builder, open Data in the side panel and choose the Documents tab. In the classic builder, open Insert in the toolbar and choose Dynamic Document, under Attachments.
Paste the link
Paste the Google Doc link, or just its ID, into Google Doc link or ID. Then choose Fetch tags (in the Pro builder the button is Scan). candl reads the Doc and lists every <<Tag>> it finds.
Match each tag
Choose what fills each tag. The next section explains the choices.
Attach
Choose Attach to campaign (Pro builder: Attach to this email). candl says Dynamic Doc attachment saved! The button stays off until the Doc has been fetched.
In the classic builder a purple bar, Dynamic PDF Attached, then shows the Doc’s name with Edit Mapping and Remove. The attachment is saved with the campaign, so it is there when you reopen it. A new email starts without one.
Remove takes the attachment off (Attachment removed.). To change it later, reopen the dialog: candl reads the Doc again and puts your earlier choices back. If you added a tag to the Doc since, it appears unmatched. Pasting a different Doc starts the matching over.
Match tags to fields
Each tag in the Doc gets a row. The picker beside it is a Standard Field: the same list as the merge tags in the builder, such as Parent Name, First Name or Grade. Connect the dataset first (see Use a dataset) if you want its columns in the list. A field that has no value for someone is left blank in their PDF.
Leaving a picker on -- Select Field -- is allowed, but then that tag is not touched. The PDF will show the raw <<TripDate>> text. Either match every tag or type the fixed text into the Doc.
If the Doc has no tags at all, candl says No <<Tags>> found in this document. It will be attached as a static PDF. Everyone then gets the same PDF.
Tables from a dataset
For a list that has a different number of rows for each family (charges, payments, a schedule), use a dataset with many rows per person. See Datasets for how to bring one in.
- Connect that dataset to this email first.
- In the tag’s row, change Standard Field to Dataset Grid. The choice only appears when a many-rows dataset is connected to the email.
- Pick the Dataset and a Display Format, then build the columns.
- Field
- A column of the dataset. Rows left on -- Select -- are dropped. The column’s name is its heading in the PDF.
- Data Type
- Text, Currency ($) (shows $1,250.00), Number, Date (Short) (3/14/2027) or Date (Long) (March 14, 2027). When you pick a field, candl guesses: a name with amount, price, fee, total or cost becomes Currency; date, time or day becomes Date (Short); qty, quantity, count or score becomes Number. Change it if the guess is wrong.
- Width %
- How much of the page width the column takes. Blank is Auto: the columns left blank share what the others leave. Total Width turns green at exactly 100% and red above it.
- Math
- None, Sum Total, Average or Count (the rows that have a value). Sum and Average are only for Currency and Number columns. Any column with math adds a last bold row, with TOTAL: in the cell to the left of the first total.
- Add Column, drag, x
- Add a column, drag the handle at the left of a row to reorder, or remove a column with the red x.
- Display Format
- Advanced Table is the table described here, with a shaded heading row and thin borders. Text List (Bulleted) writes one line per row instead and has no math.
Whose rows? For a household letter, all of the household’s boys: a family with three sons gets one table with the rows of all three. A dataset kept by household uses the household’s rows. If the family has no rows, the tag is simply blank and the table is left out.
Preview and test
Preview PDF (Pro builder: Preview a PDF) makes a sample PDF and opens it in a new tab. It needs at least one tag matched; otherwise candl says Please map at least one tag before previewing.
- Standard fields use sample values: Mr. and Mrs. Cohen, David, grade 10. This is not a real family.
- Tables use the first person in the connected dataset, so you see real rows, formats and totals.
- Preview does not use your audience. To see a real family, send yourself a test.
A test email from the builder (see Preview and send a test) builds the PDF for the family on screen, so step to a family with several rows, or none, before you send. Open the PDF in the test and check it. If the PDF cannot be built, the test is still sent, without a PDF and without an error message.
A Dry Run from the flight check makes no PDFs at all.
Name and parent portal copy
Each PDF is named after the Google Doc, the family number and the last name, with anything that is not a letter or number turned into an underscore. A Doc titled Tuition Statement for the Cohens in household 678 becomes Tuition_Statement_678_Cohen.pdf. To change the name, rename the Google Doc.
Tick Publish to the parent portal (Pro builder: Also publish to the parent portal) to keep a copy. candl saves the PDF in Google Drive and lists it, under the Doc’s name, for that student in the parent portal. Sending again with the same Doc replaces the earlier entry instead of piling up. The box says it adds about two seconds to each email.
If saving the copy fails, the email still goes with its PDF, and the failure is recorded in the logs (Portal Archive Failed; see For administrators).
Without the box, the PDF is attached and not kept. On a family’s email in the profile timeline it shows as Made for each recipient and not kept, with a Recreate button. Recreate builds the PDF again from the Doc and today’s data, so it can differ from what was sent. It is never filed to the portal. With the box ticked, the timeline opens the kept copy, The copy the family received.
Three examples
A tuition statement with a total
The Doc has the school letterhead, <<ParentName>> in the greeting, and a line by itself with <<Charges>>. The dataset Tuition Charges has many rows per student: Item, Due Date, Amount.
- Connect Tuition Charges to the email, then attach the Doc and fetch its tags.
- Match
<<ParentName>>to Parent Name. - Set
<<Charges>>to Dataset Grid, Advanced Table. Columns: Item (Text, 50), Due Date (Date Short, 25), Amount (Currency, 25, Sum Total). - Preview. The last row reads TOTAL: in the Due Date column and the sum under Amount.
A Shabbaton permission slip
The Doc says I give permission for <<StudentName>> (grade <<Grade>>) to attend… above a signature line. Match <<ParentName>>, <<StudentName>> and <<Grade>> to Parent Name, First Name and Grade. Type the Shabbaton date straight into the Doc: every boy has the same one, so it needs no tag. Send the email to the grade’s audience.
A summer schedule letter
A dataset Summer Schedule holds one row per boy per day: Day, Time, Shiur. The Doc has <<Schedule>> on its own line. Make it a Dataset Grid with Day (Text, 25), Time (Text, 25), Shiur (Text, 50) and no math. Each family’s PDF lists the days their sons are in. A family with no rows gets the letter without the table.
When it does not work
- Please enter a Google Doc URL or ID.
- The link box was empty when you chose Fetch tags (title Missing Info).
- Failed to read Google Doc: Cannot access Google Doc. Please ensure the URL is correct and the file is accessible.
- The link is wrong, the file was deleted, or you cannot open it. Open the link in your browser to check. It must be a Google Doc, not an uploaded Word file.
- Please map at least one tag before previewing.
- Match a tag, then choose Preview again (title Missing Data).
- Failed to generate preview: …
- The preview could not be built. The rest of the message says why, for example that the file is not accessible.
- A raw
<<Tag>>in the PDF - The tag was not matched, or its spelling in the Doc differs from the one you matched. Fetch the tags again and match it.
- A tag is blank
- The picked field is empty for that person, or a dataset table has no rows for the family.
- A table shows Select a dataset to begin...
- Choose the Dataset. A table with no dataset or no columns is not saved.
- No Dataset Grid choice
- No dataset with many rows per person is connected to the email. Connect one first.
If a PDF fails during the real send, the email still goes out, without the PDF. The delivery log gets an extra line for that family: PDF GENERATION FAILED: and the reason. Look for those after a large send, and check the Doc with Preview before you start. Administrators can find Dynamic PDF Failed in the logs.
A send from a profile is different: if the PDF cannot be made, that email is not sent and candl says why, so you can fix the Doc and send again. A test copy goes out without the PDF and the message after the test says the document could not be made.
Size and time. The 20 MB limit shown when you upload files applies to uploaded files only. A generated PDF counts toward Gmail’s 25 MB limit for one email like any other attachment, which a letter and a table do not come near. Each PDF is built one family at a time, so a send with a Doc attached takes longer than one without. A big send continues in the background; see after you send.