Outlook App: Email templates

Office reports as email templates for the Outlook app

Product line

Standard

|

Expert

Operating mode

CLOUD ABO

|

ON-PREMISES

Modules

Services & CRM

Budget & Phases

Purchases

Resource Planning

Business Intelligence

Created: 19.09.2023
Machine translated
Updated: 16.04.2024 | Added example of optional arguments.

Starting with Vertec 6.7, Office Reports in Vertec can be used as email templates in the Outlook App .

Like all Office reports, they allow context-dependent access to all Vertec data and can therefore be enriched with specific data for the address for which the email is created in Outlook (dynamic form of address, subject, pictures, data, etc.).

When you select the template in the Outlook app, the output of the report is used as the content of the email.

Selecting templates in the Outlook app

When creating a new email in the Outlook app, you can optionally select a template from a list. By clicking on the Create button, the subject and content of the new email are filled in or replaced accordingly:

The loading of templates can be carried out several times, with the contents being overwritten according to the up-to-date selected template.

Note: In the web edition of the Outlook app, a template can only be selected once per email, so if you want to select a different template instead of the one that has already been added, you will have to create a new email.

Creating the templates

In order for the reports to appear as e-mail templates in the Outlook app to be selected, there is a checkbox Outlook app e-mail template on the report registration in Vertec (IsEmailTemplate):

The reports, which are available as e-mail templates, must be Adresseintrag registered and from the output format Word be.

The content of the report is used as the body of the email.

The subject of the report registration is entered as the subject of the e-mail. As usual, OCL expressions, in percentage signs (%%) shall be used:

The Report Code of Office reports used as email templates is not different from other Office reports, so the coding is basically the same.

As an example, the template Email Sample Template is supplied by default.

Optional Arguments

Starting with Vertec 6.7.0.6 it is possible to access the project, phase and opportunity arguments in the Outlook app in email templates. If these are already selected, they are available as Context Variables project, phase and opportunity available in the report code.

Since the variables are only available when the corresponding values are set in the Outlook app, it is important that the code queries whether they already exist, otherwise an error will be shown.

In the following example, the fields project, subject, phasecode, phasewertoffen and opportunitytext are filled accordingly:

class ProjectLetter(Table):
    businessclass= "Adresseintrag"
    fields = [
        TextField("project"),
        TextField("subject"),
        TextField("phasecode"),
        CurrencyField("phasewertoffen"),
        TextField("opportunitytext"),
    ]
    
    def initialize_row(context, row):
        if context.project:
            row.project = context.project
            row.subject = context.projekt.betreffend
            
        if context.phase:
            row.phasecode = context.phase.code
            row.phasewertoffen = context.phase.sumwertextoffen
            
        if context.opportunity:
            row.opportunitytext = context.opportunity

These field names can be accessed in the report template as usual:

If the corresponding fields in Outlook are not set yet, an empty string is output. If you do not want this, you can either output a corresponding text in the field or set a Conditional Band .