Once you've built and saved a subtable, you place it in a Courier configuration's email message. When Courier sends the email, it replaces the subtable with a table of the related records for the record being emailed. This article explains how to add a subtable, what Courier puts in the message, how to reuse one subtable across configurations, and how to test it.
Available to: all roles with the QB Courier extension.
Drag the subtable into the message
In the Courier Configurator, open the Courier configuration you want to add the table to, and go to its Email Message tab. See Email Message tab.
On the right of the tab are two panels: Table Fields (the fields you can put in the subject and message) and Sub Table. Expand Sub Table. It lists your company's saved subtables by name (the Configuration Name you gave each one).
Drag the subtable into the Message, to the spot where you want the table to appear, for example after Here's what we shipped:.
Save the Courier configuration.
You can add more than one subtable to the same message, for example the order's line items and its shipments. Subtables must be built first; see Configure a subtable.
Important
Leave Send email msg in text format off on the Email Message tab. When it's on, Courier sends the email as plain text, and recipients see the table's HTML code instead of a table.
What gets inserted: the subtable token
Dragging a subtable into the message inserts a short token in this form:
~strid=N~
N is the number that identifies that subtable. When Courier sends the email, it finds each ~strid=N~ token, looks up the subtable with that token, and replaces the token with the finished HTML table.
Find a subtable's token in the Subtable Reference column of the Email Subtable list (the list that opens from Email Message SubTables). It shows the whole token, for example
~strid=12~. See The Email Subtable list.You can move the token anywhere in the message (cut and paste it), and you can type it yourself, copied from Subtable Reference. Dragging is the easiest way to get it right.
Keep the token whole: both tildes (
~), with nothing else between them. One subtable per token.Editing the subtable later (in the Subtable Configurator) doesn't change its token. Emails already using it pick up the new settings the next time Courier sends.
Courier fills in
[Field Name]merge fields before it looks for subtable tokens, so a formula text field placed in the message can also output a~strid=N~token. For example, a formula could pick a different subtable for different kinds of orders.
Example message:
Hi [Customer Name],
Your order [Order Number] shipped today. Here's what we sent:
~strid=N~
Thank you for your order!
Older emails: the full settings string
Before the Subtable Configurator, subtables were added by typing the whole settings string into the message, in this form:
~dbid=<table ID>,qry={'14'.EX.[Record ID#]},clist=LT6:40::.RN7:15:Qty:,stlist=9~
Existing emails that use a full string like this keep working; you don't need to change them. For new tables, build a subtable in the configurator and drag it in instead: it's easier to read and edit, and it keeps a version history. The string's parameters are described in QB Courier including embedded reports.
Use one subtable in several configurations
A subtable belongs to your company, not to one email. You can add the same subtable to any of your Courier configurations. For example, an Order line items subtable can appear in both an order confirmation and a shipping confirmation.
For it to work in a configuration, the configuration has to be able to fill in the subtable's filter:
The subtable's filter compares child records with fields on the master record (conditions that use the value in the field (parent)). Courier matches those parent fields by name.
So the configuration's master table needs a field with exactly the same name as each parent field in the filter, including capital letters and spaces. Check the names before you add the subtable. In practice, use the subtable in configurations that send from the same master table as the Courier configuration you attached it to.
If the configuration uses a report, include those parent fields in the report.
Important
Changing a subtable changes it in every email that uses it. Before you edit a shared subtable, check which configurations use it, or create a new subtable for the change.
Test the email
The configurator's Simulate Subtable view uses sample data. To see the table with your real records, send a test from the Courier configuration. See Test Configuration tab.
In the test email, check that:
The table shows only the related records for the test record (your filter and its parent field are right).
The columns, headers, order, totals, and formatting look the way you want in your email client.
The table appears where you put the token. If you see settings text such as
dbid=...instead, the subtable has no columns or no filter: complete its Fields and Filter tabs and save.
If no test email arrives, the table may not have been built. Check the configuration's activities (see below).
If Courier can't build the table
Courier builds the table separately for each record when it sends. If it can't build the table for a record, it doesn't send that record's email. The other records' emails still go out.
Where to see the error: open the configuration's activities (the Activities icon on its row in the Courier Configurations list), find the run, and open its Processing Details. The record is listed under Records Not Processed. For a test, the sample email isn't sent. See Configuration activities.
Errors in the subtable's settings start with Unable to include HTML table in your email body message.
A mistyped token, or a token for a subtable that was deleted, also stops the email. Fix the token with the value from Subtable Reference. If a subtable is deleted, remove its
~strid=N~from every message that uses it; otherwise Courier doesn't send those emails.
For each message and what to do, see Courier Subtable Configurator messages and troubleshooting.
Need help? Submit a technical support case.