Skip to main content

Email Delivery

1. Purpose of the Feature

The email sending feature in Asset Manager enables automatic bulk emails based on database queries:

  • Recipients are retrieved from a data source.
  • Content (subject line, body text, optional calendar invitation) is dynamically generated using templates and placeholders.
  • Attachments can be selected from the central file repository.
  • A schedule controls when the template is executed.

A prerequisite is a functioning email configuration (SMTP) and at least one valid email template.


2. SMTP Configuration (Email Settings)

Before creating templates, the outgoing mail server must be set up.

2.1 Fields in the SMTP Settings

The following information is typically required in the email settings dialog:

  • Server
    Hostname or IP address of the SMTP server.
  • Port
    Typically 25, 465, or 587—depending on the server used.
  • Sender Email
    Address that appears as the sender in the recipients’ inboxes.
  • Sender Name
    Custom display name shown in the email client.
  • Username
    Login for the SMTP server.
  • Password
    Password for the user account. The password is stored in encrypted form.
  • Security option (encryption)
    Selection of whether and how the SMTP server is accessed using encryption (e.g., no encryption, automatic, SSL/TLS, STARTTLS).

2.2 Test connection

A button is available in the dialog to test the connection:

  • The currently set values are used.
  • The Asset Manager checks whether it is possible to log in to the SMTP server.
  • If successful, an informational message is displayed; if an error occurs, a corresponding message is shown.

Only after this test has been completed successfully should you begin creating templates.


3. Email Templates: Structure and Components

An email template consists of several components:

  1. Data sources (SQL queries)
  2. Email content (Subject, Body, CC/BCC)
  3. Schedule (Execution interval)
  4. Optional: Calendar entry
  5. Optional: Attachments

The template is created or edited in the corresponding dialog, which contains several tabs (e.g., SQL Query, Email Template, Calendar, Attachments).


4. Data Sources (SQL)

4.1 Basic Concept

  • Data sources are SQL queries that are executed when the template is run.

  • The result forms the basis for recipients, placeholders in the text, and optional calendar data.

  • There are two logical roles for data sources:

    • Email data source: provides the recipient address and other fields.
    • Additional data sources: provide supplementary information (e.g., asset data, customer information).

There must be exactly one data source that serves as the email source and provides a recipient address. This column must be named RecipientEmail.

Additional data sources used for supplementary information must also contain a RecipientEmail column; otherwise, mapping will not be possible.

4.2 Typical Procedure for Setting Up Data Sources

  1. Create a new data source on the SQL Queries tab.
  2. Formulate the SQL query so that it returns all required columns:
    e.g., recipient address, name, asset number, dates, etc.
  3. Mark this data source as an email source (if provided in the dialog).
  4. Optionally, create additional data sources that provide extra columns.
  5. Test the query using the available Run function and check the result.

When saving the template, Asset Manager checks:

  • whether an email data source exists at all,
  • whether there is exactly one email data source,
  • whether a column for the recipient address exists in the data.

If problems occur, corresponding error messages are displayed and the template cannot be activated.


5. Placeholders (Variables) in the Subject and Text

5.1 How It Works

  • Columns from the defined data sources can be used as placeholders in

    • Subject,,
    • Summary (for calendars)
    • Email text
    • Calendar description.
  • A placeholder is usually enclosed in curly braces:
    {ColumnName}

  • When the email is sent, the placeholder is replaced by the specific value for each record.

Example (schematic):

  • Column CustomerName
  • Subject: Maintenance appointment for {CustomerName}
  • The actual email sent to a person would then contain, for example,  Maintenance appointment for John Doe Inc.

5.2 Selection Assistance

  • In addition to the subject and summary, a list of available columns can be displayed.
  • Depending on the configuration, a list of available placeholders can be displayed in the email editor.
  • A placeholder can be inserted either by selecting it from the list or by typing it directly in the form {ColumnName}.

6. Email Template: Content and Options

The following information is stored on the Email Template tab:

6.1 General Information

  • Name
    The name of the template in the Asset Manager.
  • Enabled
    A toggle that determines whether the template is enabled for automatic sending.
    If the template is inactive, no emails will be generated based on this template, even if a schedule has been defined.
  • Avoid Sending Duplicates
    When this option is enabled, the system prevents the repeated sending of identical emails.

6.2 Recipient Control

  • CC Field
    Column from the data sources that contains additional recipients in the CC field.
  • BCC Field
    Similar to the CC field, but for blind carbon copies.

These fields can be populated with placeholders (columns from the data sources).

6.3 Subject and Email Text

  • Subject
    Free-form text that may contain placeholders.
  • Email Text (HTML)
    A formatted HTML layout can be created using an editor (fonts, paragraph formatting, simple tables, etc.).
    Placeholders can also be used here.

7. Scheduling (Cron expression)

Email delivery is controlled by a schedule stored as a cron expression.

7.1 Cron Input Field

  • The template dialog contains an input field for the cron expression.
  • Next to it is a button that opens a help dialog to assist in constructing the expression.
  • A plain-text description is displayed below the input field (e.g., “Every hour between 8 a.m. and 6 p.m., Monday through Friday”), provided the expression is valid.

7.2 Rules and Validation

When saving the template, the following rules, among others, are checked:

  • The schedule must not be empty.
  • The resulting interval must not be too small.
    The Asset Manager checks whether the scheduled executions are spaced at least approximately one hour apart within the check period.
    If the interval is shorter than this, a corresponding error message is displayed.

If the template is active, it is executed by the Asset Manager Service’s background service according to this schedule.


8. Optional Calendar Events

In addition to sending emails, a template can create calendar events (e.g., appointments in a calendar).

8.1 Enabling

On the Calendar Events tab, there is a toggle to enable calendar events. Only if:

  • the template itself is active and
  • the calendar switch is turned on,

will calendar events be created.

8.2 Fields for Calendar Events

Typical fields:

  • Location
    Placeholders from the data sources.
  • Start Time / Date
    Column with date/time from the data sources.
  • Duration (minutes)
    Column for the duration.
  • Summary
    Title of the appointment. May contain placeholders.
  • Description
    Detailed description text; placeholders are also possible here.

All required fields must be filled in as soon as the calendar is enabled. Missing information is acknowledged with a message when the template is saved.


9. Attachments

On the Attachments tab, you can select files from the Asset Manager’s central file repository.

Typical workflow:

  1. Open the context menu in the attachment grid (e.g., by right-clicking).
  2. Add new attachments using the file selection dialog.
  3. Selected files appear in the list of attachments.
  4. Remove attachments that are no longer needed via the context menu.

When sending, all attachments stored in the template are attached to each generated email.


10. Typical Workflow: Create a New Email Template

  1. Check SMTP Settings
    Open the Email Settings dialog, enter the server details, and run a connection test.

  2. Create a New Template

    • Open the Email Templates dialog.
    • Create a new template.
    • Assign a name and icon.
  3. Define data sources

    • On the SQL tab, create an email data source that contains at least one column with recipient addresses.
    • Optionally, create additional data sources for extra content.
    • Run queries and check the results.
  4. Update placeholders

    • Ensure that the data sources are correct so that the list of available columns/placeholders is up to date.
  5. Build email content

    • Define the subject line using static text and placeholders.
    • Create HTML text in the editor and insert placeholders.
    • Fill in CC/BCC as needed.
  6. Set schedule

    • Enter a cron expression or create one using the help dialog.
    • Check the description to ensure the desired interval is met.
  7. Calendar (optional)

    • Enable the calendar function.
    • Enter location, start time, duration, summary, and description (using placeholders if necessary).
  8. Attachments (optional)

    • Open the “Attachments” tab.
    • Select and add files from the file repository.
  9. Activate and save the template

    • Enable the template.
    • Close the dialog with OK.
    • Address any error messages until the template can be saved without errors.

From this point on, the system will run the template regularly according to the schedule; emails (and calendar events, if applicable) will be generated for each record in the email data source.