ObjectGears Help

Forum   ObjectGears (Version:

Notification from a script

ObjectGears supports notifications on number of places in the system, where user can specify easily recipient, subject and body of the message etc.

Furthermore, there is possibility to send notification also from a script. This represents a highly general functionality when notification can follow whatever necessary logic. There is script object Email, that offers two methods:

  • SendEmail
  • SendNotification

Example 1:

This command sends an email to address support@objectgears.com, with subject 'Request for support', email body 'Body of the message....', normáal priority and in plain text (not html)

OG.Email.SendEmail('support@objectgears.com', 'Request for support', 'Body of the message....', Com.ObjectGears.Common.Entities.NotificationPriority.Normal, 0);


Example 2: 

This command sends a notification 'request_created' from model 'it' to distribution group 'service_desk'.

You can use command {{var.calcfee}}, which contains a text compiled in the below stated example, in the notification 'request_created'. You can use whatever number of variables like variable 'abc' utilizing method OG.CreateHashtable and parameter ht in this example.

You can use also e.g. command {{var.DataRow.Url}}, that inserts URL to the data record with which the notification is associated via parameter OGActualDataRow.

var ht = OG.CreateHashtable();

ht['calcfee'] = 'Calculated fee: 78,00 USD.';

OG.Email.SendNotification('it', 'request_created', 'service_desk', OGActualDataRow, ht, Com.ObjectGears.Common.Entities.EmailOwnerType.ClassDef, OGActualDataRow.ParentId);

This website is using cookies files to provide services and analyse visits. You agree with that by using this website.     Further information