Skip to content

Email reporter - installation

The Email reporter basically consists of several modules:

  • Plugin: CortexEngine plugin for configuring reports
  • Scheduler: Python module for sending configured reports by email

Install the plugin in Remote admin

The desired CortexEngine instance must have a license for the plugin!

Uniplex required!

This plugin can only be used in the context of the Uniplex!

Tip: In the Starter edition and the User group edition, the Uniplex is already pre-installed.

This plugin is installed using the Remote admin.

Here's how it works: install plugin

Overview Remote admin

  • click the button Apps/Plugins (area 3) in the main window of the Cortex-IP Remote admin

  • the plugin is selected and installed via the buttons Directory Import (for plugin in folder form) or File Import (for plugin as XJZ file):

    Administration plugins

The plugin must be activated for all desired users by selecting the corresponding permission.

Here's how it works: set user permissions

Remote admin Übersicht

  1. click the button User (area 3) in the main window of the Cortex-IP Remote admin

  2. select the desired user in the UserDialog and click the button Edit:

    User select

  3. set the desired permissions in the UserInputDialog in the options/applications area:

    User permissions

Plugin used in Uniplex

Activate and assign the plugin

After installation in the CortexEngine, the following steps activate the plugin in the Uniplex. Once the plugin has been assigned to a user, the corresponding button is available in the quick launch bar.

  1. activate the plugin in one (or more) plugin template(s)

    Here's how it works: activate a plugin under Plugin templates
    1. open the Plugin templates

      Plugin templates

      The button Add Add is used to configure new entries and the button Edit Edit is used to configure existing entries.

    2. select the desired template and activate the plugin Email reporter

      Plugin template editor

      In the dialog header, a template can be created with the button Add Plus and another template can be selected with the button Load template Select. The template will be removed with the button Delete template Delete.

      Parameters Meaning Note
      name meaningful name of the plugin template
      available plug-in buttons plugins available in the CortexEngine activate with Plus
      activated plug-in buttons plugins that should be visible for users with this plugin template remove with Minus
      change order with Up and Down
  2. assign the plugin template(s) to the desired users in the user administration

    Here's how it works: assign the plugin to users
    1. open the tab Templates under user administration

    2. assign the desired plugin template to the user

    3. click the button Save changes (or Cancel on the top right)

    4. close the system settings

    The button with the name of the plugin appears in the quick launch bar on the left.

Field and record type definitions

To be able to manage report configurations in Uniplex, its fields and record types are required.

  • download and unzip the file
  • import the field definitions (in file !FId.json)
  • import the record type definitions (in file #Dst.ctxexp)

Perform import separately

Fields and record types must be imported separately!

Here's how it works: importing field and record definitions

The import function is located at the bottom left in the system settings.

It opens the dialog Import configurations.

Import configuration

  1. select the configurations to be imported and confirm with the button Import selected Import

  2. select the file with the configurations you want to import in the File selection dialog

Scheduler

Python Version 3.11

The Scheduler module requires Python version 3.11 or higher!

The Scheduler is a Python-based module that realizes the sending of email reports.

It runs outside the CortexEngine at system level and can either be started manually on demand or regularly via CronJob.

pip install emlrep-scheduler-[version].tar.gz

Example:
pip install emlrep-scheduler-2.0.2.tar.gz
Tip: Add $PATH

To simplify use, it is recommended to add the module to the system path:

  • find installation location
    pip show emlrep-scheduler
    
  • include in $PATH (e.g. .zshrc or .bashrc)
    export PATH="$PATH:[/absolute/path/to/installation/folder]"
    

Configuration

The configuration is carried out via emlrep.ini, which is divided into the following categories.

Dataservice

To be able to read the reports for delivery, the scheduler requires access to the CortexEngine data inventory.

This access takes place via the Uniplex interface:

emlrep.ini
[DATASERVICE]
no_rec_found=Keine Datensaetze gefunden.
link=localhost:8888/Uniplex/updjsr.php
user=admin
password=admin
Parameters Description
no_rec_found requested response if no reports were found
link URL of the updjsr.php in a running Uniplex instance
user login user name of the linked Uniplex instance
password login password of the linked Uniplex instance

Mailserver

A mail server is required for sending emails:

emlrep.ini
[MAILSRV]
hostname=mailserver.cortex-ag.com
user=cron-mailer@cortex-ag.com
passwd=password
from=Emailreport <no-reply@cortex-ag.com>
ssl=0
port=587
Parameters Description
hostname URL of the mail server
user login user name for mail server
passwd login password for mail server
from desired sender address
ssl Should SSL be used for the connection to the mail server? (0 = No, 1 = Yes)
port access port for mail server

Administrator

emlrep.ini
[ADMIN]
error_emails=report.admin@cortex-ag.com
debug=False
cron_interval=day
Parameters Description
error_emails recipient address for administrative/debug emails
debug Should emails be sent to the error_emails recipients and not to the recipients defined in the reports? ('False' = No, 'True' = Yes)
cron_interval How often should the scheduler be executed? ('day' = 1x daily, 'hour' = 1x per hour) (*1)

*1: Hour input in the plugin

If cron_interval = day - i.e. delivery 1x per day - is configured, the hourly input is hidden in the plugin UI.

Configuration - web server

The web server that serves the desired instance of the CortexEngine requires the path to the emlrep.ini file.

This is communicated to the web server in its httpd.ini file:

httpd.ini
[HTTPSRV]
.
.
.
SERVERVAR_EmailReporterINI=/absoluter/pfad/zur/emlrep.ini