Skip to content

Messaging

Verified against source (11)

  • message/Message.cs
  • message/MessageTemplate.cs
  • message/MessageTemplate.Fields.cs
  • Configuration/MailInbound.cs
  • Configuration/MailProcessor.cs
  • Config/Message.config
  • message/app.config
  • qbo4.Message/README.md
  • qbo4.Message.Bridge/MethodSignatureProcessor.cs
  • Installer/Setup.Message.Bridge.xml
  • Extensions/MessageExtensions.cs

Power users shape messaging in two places: message templates, which define what QBO sends, and inbound accounts, which define what QBO does with email it receives.

Create a template from Templates > Messages, choosing an HTML or text body. Each template sets:

Setting Property Purpose
Name MessageTemplate How users and workflow steps refer to the template.
Applies to ParentObject The kind of record the message is about (a process, a contact, an organization), which decides the data available to merge.
Subject Subject The subject line, with merge fields.
Body BodyHTML / BodyText The message body, with merge fields. If you only write HTML, QBO creates the plain-text version for you.
Body transform BodyXsltID Optional XSLT that renders the whole body from the record’s data, for layouts the editor can’t express (tables, loops, conditions).
Data Method Optional method signature that fetches the data to merge, when the record’s standard data isn’t enough.
Sender FromAddress / FromName The address and display name the message is sent from.
Recipients ToContactID, CcContactID, BccContactID, and the matching …CollectionID Default To, Cc, and Bcc recipients (see Recipients).

Like other templates, message templates support custom statuses and types and partner (extranet) security. See Templates.

From a template’s summary page you can Copy it, or Compose a new message from it.

Wrap a field name in curly braces to merge it into the subject or body. The field picker at the end of the Subject and Body fields inserts them for you.

Merge field Becomes
{Field} That field on the parent record. On a contact, Dear {FirstName} becomes Dear Maria.
{//xpath} Any value in the record’s data, using an XPath expression, for example {//AttachmentItem[1]/AttachmentID} for the ID of the record’s first document.
{BaseUrl} The address of your QBO installation, for building links back into QBO.
{SecurityToken:{user}:{access}} A one-time access token for the named QBO account, governed by the named security access settings. Use {SecurityToken} to reuse the same token elsewhere in the message, and {SecurityTokenExpiration} to tell the reader when it expires.

Values passed to the send call (for example, from a workflow step) are merged too, so a step can supply details that aren’t stored on the record.

To link to a document on the record, merge its ID into a download link:

<a href="{BaseUrl}/api/attachment/download?ID={//AttachmentItem[AttachmentTemplate='Signed Agreement'][last()]/AttachmentID}">Download your signed agreement</a>

A template’s default To, Cc, and Bcc recipients each point to a contact or to a collection (a distribution list). For a contact, every contact method is evaluated by type:

Contact method type Adds
Email That email address.
XPath The address found by merging the expression against the record, for example the email of the record’s primary contact.
Method Every Email (or every contact’s email addresses, from a ContactID column) returned by a method signature, for example all the active parties on a process.

This lets one template address “whoever is the current contact for this record” without anyone typing an address. Calls can also add recipients with ToMethod, CcMethod, BccMethod, and ReplyToMethod.

  • Header and footer: create message templates for your standard header and footer, then set the MessageTemplateHeader and MessageTemplateFooter settings (Configuration > Modules > Message > Settings) to their names. They wrap every outbound email.
  • Confidentiality notice: the ConfidentialityMessage setting appends a notice to every outbound email.
  1. Add an inbound account for the mailbox: a name, the receiver plugin (IMAP, Microsoft 365 with OAuth, or Microsoft Graph), host, account, password or credentials, port, and SSL.
  2. Add one or more processors that decide what each email is about.
  3. Schedule the receive operation, or run it from a workflow step.

Each email becomes a message with its To, Cc, and Bcc recipients, and each attachment becomes a document. QBO remembers which emails it has already imported, so running the receive operation again never creates duplicates.

A method signature processor runs a statement for each new message. The first processor that returns a row wins: QBO updates the message from that row (for example, setting the record it belongs to) and stops. If no rows come back, the next processor runs. Typical processors:

Goal Approach
Thread replies The standard BindByParentMessage statement finds an earlier message whose subject appears in the new one, and copies its record and thread. It also sets the message template: ParentTemplate for new conversations, ChildTemplate for replies. Short subjects are ignored (SubjectLength, default 30 characters) to avoid false matches.
Link to a record A statement that searches for a reference number in the subject and returns the record’s Object and ObjectID.
Start a workflow A workflow launched from the message, for example to acknowledge receipt and import an attached spreadsheet.
Reply automatically A send call using a canned-response template, addressed to the sender.

Setting the message template on an inbound email is a convenient trigger: a listener on that template can launch whatever workflow should follow.

A processor can also set BindAttachmentsToMessage to keep attachments on the message instead of moving them to the record, and an attachment statement to set properties on each attachment, such as its document template based on its file name.

Messages can be classified with a score template, so inbound email is categorized as it arrives.

Create a message template named LoginHome and add messages to it. Their HTML bodies appear on the login page.

See all messaging integrations on the Integrations page.