Email Template
The email template provides users with predefined email messages. The subject, recipients (To, Cc, Bcc) and the HTML content are defined in the template editor. Dynamic content is inserted using the {{FieldName}} syntax, populated by Forms fields and Fields.
Creating a Template
- In primedocs Desktop, click «New Template» and select «Email» (Microsoft Outlook category).
- In the template editor that opens, click «Editor» to open the HTML template editor.
- Select the document language from the drop-down menu.
- Enter the subject line.
- Enter email addresses in To, Cc and Bcc (separated by semicolons
;). - Prepare the email content in Outlook (New). Use the primedocs Add-In (Templating menu) to generate the HTML.
- Copy the HTML into the «HTML Content» field in the template editor.
- Insert dynamic fields using the
{{FieldName}}syntax. - Create the plain text using «Extract text from HTML».
- Save and test the template.
Example
<p>Hello {{Recipient.FirstName}} {{Recipient.LastName}}</p>
<p>{{Forms.Email.Body}}</p>
<p>
Kind regards<br/>
{{Profile.User.FirstName}} {{Profile.User.LastName}}
</p>
Data through Connect (Data)
In addition to Forms and Fields values, an email template can receive additional data through the Data document function. A typical case: a third-party system calls the template through Connect and supplies the subject, recipient and content data along with it, without any user input.
Configuring the template
-
In the template editor of the email template, switch to the Document functions tab and add Data.
-
Define the schema of the expected values in the
DataConfigurationXML:<DataConfiguration><Schema><Text Id="Subject" /><Text Id="Recipient" /><Object Id="Customer"><Schema><Text Id="Name" /></Schema></Object></Schema></DataConfiguration> -
Use the values through
{{Data.<Id>}}in the template — in the subject line, in To, CC and BCC, and in the HTML and plain text content:Template field Content Subject {{Data.Subject}}To {{Data.Recipient}}HTML content <p>Hello {{Data.Customer.Name}}</p>
Connect call
The values arrive in the Data element of the Connect call (Structure):
<primedocsConnect>
<Data>
<Value Key="Subject">Your quote</Value>
<Value Key="Recipient">contact@example.com</Value>
<Object Key="Customer">
<Value Key="Name">Ada Lovelace</Value>
</Object>
</Data>
</primedocsConnect>
Restrictions
WordContentis not supported in email templates. Passing such a value aborts generation.FormattedTextis only allowed in the HTML content. A reference in the subject, in To, CC, BCC or in the plain text content aborts generation.- The preview in the template editor receives no Connect payload. Data-based content can only be checked through an actual Connect call.
To keep the template out of the manual template selection, set its Windows client visibility to "Only visible in Connect template picker" or "Hidden". A direct Connect call is unaffected, provided the permissions allow it.
Disable signature
If an email template already embeds the signature in its content, the template flag "Disable signature" prevents an automatic Outlook signature from being added on top.
The flag is honoured by the Desktop Client's Outlook add-in (Outlook Classic) — both when the recipients change (internal ↔ external) and when the sender switches to a shared mailbox. In both cases a signature that Outlook inserts automatically is removed, so the signature embedded in the template is preserved.
Default Signature in Plain-Text Emails
The Outlook add-in also inserts the automatic default signature in plain-text emails and uses the current email format. For plain text, primedocs uses the separately maintained plain-text content of the signature template. If it is empty and HTML content is available, the plain text is derived from the HTML. Embedded images are omitted from plain-text emails so that they do not appear as loose attachments.