1. Notifications

    Artikel: AN0001942Aktualisiert:
    Die vorgegebene Sprachenversion vom Artikeltext wird angezeigt, weil es kein Text von der ausgewählten Sprache und Version gibt.

    ObjectGears system has a sofisticated functionality for sending notifications via emails or SMS.

    Notifications

    There is a definition of the notification, that is is filled in with data before sending out.

    You define texts in the notification relating to a single specific action/event, for which you want to notify users.

    If you want to have all the notifcations in the same format, e.g. same beginning and end of the notification, text included in a nice frame etc., use Email template (see hereinafter).

     

    There are variables used in the notification definition for filling in text of notification with current data. Names of variables depend on where is the notification called from. One set of variables is used from calls from a class, another set from calls from an import etc. Variables can be used both in subject and body of the notification.

    If you use a variable, that cannot be used in a rule (e.g. variable related to import in the class rules), notification will not be sent. If you use a variable, there will an error message in the email.

    Example:

    User {{var.import.person.fullname}} executed an import.

    Import id:                              {{var.import.id}}
    Import name:                            {{var.import.name}}
    Count of rows in the file:              {{var.Import.FileRowCount}}
    Count of rows inserted into a class:    {{var.Import.InsertRowCount}}
    Count of rows updated in a class:       {{var.Import.UpdateRowCount}}
    Count of rows deleted in a class:       {{var.Import.DeleteRowCount}}
    Count of rows deleted before the import:{{var.Import.DeleteBeforeRowCount}}
    Count of rows deleted within the import:{{var.Import.DeleteAfterRowCount}}

    Import result: {{var.Import.ResultStatus}}
    Error message: {{var.Import.ErrorMessage}}

    By the setting Enabled you can disable a single notification without deleting it. You can have more types of a particular notification and switch them each for another. E.g. in case you want to change a text of the notification temporarily and then bring it back later on.

    Checking the option Send in HTML format makes the email to be sent in HTML. In such case you HTML in the body of the notification. If thos option is not checked, email is and in Plain text format.

    Plain text shall be used for older email clients or if the email is received by a program. Program will easily process plain text than html.

    Languages

    Notifications are ready to be used in organizations where more languages are used. Therefore, you can create a localized notification version for each language. There is setting Language, which determines the language of the given notification version. You can create whatever number of language versions for each notification, but for each language max. one. In order to add language version of the same notification use the same code but with another language.

    When creating notifications for more languages, create the first notification WITHOUT selected language. In this default version use such a language that the most of your users understand. This notification will be used when the use will not have set a preferred language or his/her language will not be defined in either notification version.

    E.g. define a notification without selected language and other versions for English and German. If the user will have set French language, he will receive the first version without set language.

    The picture below shows how notifications are sorted in the list of notifications. Notification with code im-run has  3 definitions (defaukt version without language, English and German versions).

    Každé upozornění by mělo být napsáno pouze v jednom jazyce.

    Email template

    Email templates represent an easy method for the same look of all the notifications. You put only the own message text into the notification and all the other formatting into the template. Whenever in future you can change a single template fast.

    Do not put a text related to a particular event in the template, only general texts like reference to company, intranet, helpdesk...

    When you define a template you have to know wheather an email (plaint text or HTML) or SMS will be sent.

    Put the text {#} in fields Subject and Body, where content from the notification shall be placed. This will be replaced by a current text at the time when notification is send.

    You can create more templates and use them as needed. If you do not state model in the template definition, the template will be available for all the notifications. Use such an template e.g. for a generic enterprise look.

    Distribution group

    When using notifications it is often not good to specify particular users. These user can change during the time which increases administration demands. This is why distribution groups are used ObjectGears system. It is object that already contains particular users, their email or phone to which the notification shall be sent.

    You then need to maintain users just in these groups. These groups may be filled in also automatically on database level based on certain rules by a script that you will create.

    E.g. ll the users on position Director may be in group Directors. All the users working in Prague may be included in a group Locality_Prague. Automation will save you a lot of work.

    Property Enabled determines whether notifications shall be sent to such a distribution group. When you need to disable sending notifications to such a group, you just check off this setting and notifications are never more sent again. Therefore, it is not necessary to go through all the notifications where the group is used and remove it from all these notifications.

    Sent emails

    All the generated emails and SMS can be found in Administration / Notifications / Sent email. There is information, when and with which text an email was created and wheather it was already sent.

    Emails are not sent immediately due to performance reasons but are just created and stored in the database in the first phase. After that windows service goes through all the emails that were not sent yet and attempts to send them. If the emails are generated but not sent, check wheather the windows service runs correctly.

    There is check of correct email sending configuration performed at the moment of physical email sending. Condition checked is proper setting of email in the parameter FROM in the configuration file of the windows service. In case sending is not configured, email is marked by status Email sending is not configured and email will not be sent. You can utilize this behaviour in non-production environments. You can utilize full functionality of email generation and at the same time any "test email" will not be physically sent.

    Blind copy

    ObjectGears system enables to check wheather emails were really sent by means of BlindEmail setting in configuration. System can generate emails but if there are problems on mail server the email may not be physically sent. By setting BlindEmail you add a new recipient to each email in a blind copy which causes copy of all emails going to the given mail box.

    When users claim they have not received an email, you can easily check it was really phyiscally sent. Only  Při reklamaci uživatele na případ, že mu nepřišel email lze lehce zkontrolovat zda byl opravdu fyzicky odeslán. When solving problems check max. limit of sent emails per a period of time (e.g. sending limit for one server per hour). When exceeding this limit emails may be dropped by the mail server. 

    Possible problems when sending emails on the mail server are:

    • too long text in the subject or body
    • too many email recipients

    Where notifications can be used

    Notifications can be set for several types of objects:

    • class
    • class rule
    • automated time operation of the class (ATO)
    • import
    • export
    • workflow activity

    You are defining when a notification shall be sent, which notification and which distribution group. You can create whatever number of such definitions in whatever combination.

    Notifications can be also sent by means of scripts. Necessary functions are contained in the script object OG.Email.

    Notification group

    If you define a rule for sending a notification on a class, there is also property Name of the notification group. This property together with property Order can help you in following scenario.

    You have a company where employees work in various cities and notification that says that the user shall do something (e.g. consult somebody to solve some issue). In each city the issue is solved by another person and in another way.

    There are two possible solutions:

    1. Create a single notification and describe in it how to solve the issue for all cities. As a result you will get very long and confusing email, where only a small part of the text will relate to particular user.
    2. Create a notification for each city and use Name of the notification group

    When notifications are sent they are processed according to their Order from the least to the highest. Each notification is be processed separately and therefore a single email can be sent to a single user from each notification.

    When Name of the notification group is set for more than one rule, system keeps record of users that have already received the notification. When next notification with same name of the notification group is processed the system does not sent anything to these users.

    Thic can be effectively used in our example. You ceate several notifications (one for each city) and set various Order for them. You also create one notification for each city. You specify condition in that rules in order first the users from the first city are selected. In the second rule you will select users from the second city. In the last rule you will specify all the users. Those that already received something will be ignored, the other ones will receive an universal notification. 

×