Description

Send a Notification to a collection of Users and/or Groups and/or External email addresses.

A Log file is generated if a LogIdentifier is provided, no log file is created if the LogIdentifier is Nothing. Please see Log Files for more information

Syntax

Sub SendUserOrGroupOrExternalNotification(userID as integer, objVer as ObjVer, MessageTemplate as string, userOrGroupIDs as UserOrUserGroupIDs, externalEmailAddresses as Strings, LogIdentifier As Object

Parameters

Name

Data Type

Description

userID

integer

ID of current M-Files user

objVer

objVer

ObjVer of the object being processed. This can be provided by the event handler or created dynamically using CreateObject("MFilesAPI,ObjVer")

MessageTemplate

string

Name of the Template to use for the notification message

userOrGroupIDs

UserOrUserGroupIDs

Collection of UserIds and/or GroupIDs to send the Notification too

externalEmailAddresses

Strings

Collection of email addresses to send the Notification too

LogIdentifier

String or TypedValue

Used to determine the filename of the log file. To create a log file for the current activity pass in the provided ActivityID. If this parameter is Nothing, then no log file is generated.

Return

None

Example

'create PentagonDOCS Notification object

Set ExDOCSNotification = GetExtensionObject("PentagonDOCS.Notifications")


'create a list of users to send to

Dim usersOrGroups : Set usersOrGroups = CreateObject("MFilesAPI.UserOrUserGroupIDs")

Dim UserID: Set UserID = CreateObject("MFilesAPI.UserOrUserGroupID")

UserID.UserOrGroupID = 31

UserID.UserOrGroupType = 1 ' User account type

usersOrGroups.add -1,UserID 'add user Id's and group ID's to the collection


'create a collection of external email address

Dim externalEmail : Set externalEmail = CreateObject("MFilesAPI.Strings")

externalEmail.Add -1,"notificationsExample@Pentagon.co.uk"


'call SendUserOrGroupOrExternalNotification

ExDOCSNotification.SendUserOrGroupOrExternalNotification CurrentUserID.Value, objVer, "default", usersOrGroups, externalEmail, ActivityID