You are here: Home / Extras / Templates / Macros



Templates for emails and letters are only really helpful if the name of the addressee, the property number and the property data do not have to be inserted each time before sending.

With macros this is made possible in onOffice enterprise. You can access all fields in address or property data records via macros and have their contents entered when sending an email, for example.

In addition to the data from addresses and properties, you can insert many other details by macro, e.g. data on the contact person for a property, the caretaker, addresses and legal information from the basic settings/office groups, links to download brochures – linked to the cancellation confirmation.
The macro list ( “?” >>Macro List) gives an overview of the most common address and property macros, as well as the other macros.
The macros usually work for emails and for letters (Word) unless otherwise specified in the macro list. In PDF’s only macros that output text are working at the moment.
The sample templates of onOffice use all macros, there you can see and copy practical examples of use.

For macros and templates there are tutorials and webinars, e.g. “Word Templates & Document Management” or “Email Templates & Signature”

Expert Information – Field is not included in the macro list.

Each field of an address, property data record can be addressed via a macro. The macro consists of a _ (underscore) followed directly by the database field name. The database field name can be looked up in the Administration, under Tools >> Settings >> Administration >> Input fields column “Field”.

You can also address individually created fields as macros.

Example address, property and user macros

As you can see 3 places are marked.

  1.  _Briefanrede; gives the name of the person addressed.
  2.  _objeknr_extern _objekttitel _plz _ort, _strasse; specifies the data on the linked property
  3.  _Benutzervorname _Benutzername; displays first and last name of the user.

In the preview, the macros are already replaced with the values from the linked address/property:

Example Links through macros

In addition to address, property and user macros, there are also macros that output a link in the email. These are used, for example, for download links, address completion or the follow-up of appointments.
The link can be displayed as a long URL or as text for some macros.

To set a link text for a macro with link, protocol “other” must be selected in the CKEditor when “Insert link” is selected.

Macro links in the CKEditor

For more information about links in the CKEditor, see the upper formatting toolbar.

if Macros

Sometimes a field in an address or a property is not filled in, in such a case “nothing” should not be output but e.g. a certain text. The same applies if, for example, the number of rooms or the area exceeds or falls below a certain value.

For these cases there are the “if-Macros”, “_ifEmpty(_makro;”Text1″;”Text2″)”, “_if(=value condition;”Text1″;”Text2″)” and “_calculate(calculating formula)”. Details on the use of this macro can be found in the macro list under other macros.
Please note that the macro ifEmpty cannot be used to query boolean field values (checkboxes), as these fields always have a value entered, 1 or 0.

Please remember, if you want to use formulas or field contents such as [kaufpreis] instead of macros, the _calculate([field name]) macro MUST be used.

_if(”_anzahl_zimmer”<”10″;”_anzahl_zimmer Zimmer”;”several bathroom’s”)
_if(”_calculate([kaufpreis])”<”1000000”;”price on request”)

Please note that there may be problems with the resolution of field names that use an underscore.
For example, [anzahl_Badezimmen] is recognized as macro _Bad.

Individual macro list

Besides the standard fields you can also create your own fields in addresses and property in onOffice enterprise. These fields can also be used via macros in templates.

You can get the list of these macros via ? >> Individual macro list is displayed.