The M-Files Community will be updated on Tuesday, April 2, 2024 at 10:00 AM EST / 2:00 PM GMT and the update is expected to last for several hours. The site will be unavailable during this time.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Adding an attachment to a notification VBScript

Hi, I am trying to create a script that attaches an M-Files generated document to an email notification. Normal email scripts don't seem to work with our servers, so I was wondering if it is possible to download a document from M-Files and attach it to a notifications via a workflow state script with VBScript? I have attached the the piece of code that I would like to use to send the email notification (and attachment) below.

Thanks

Option Explicit

' User or user group recipients from the vault
Dim oUsers : Set oUsers = CreateObject("MFilesAPI.UserOrUserGroupIDs")

Dim oUser : Set oUser = CreateObject("MFilesAPI.UserOrUserGroupID")
oUser.UserOrGroupID = 1	' User ID 32
oUser.UserOrGroupType = MFUserOrUserGroupType.MFUserOrUserGroupTypeUserAccount

oUsers.Add -1, oUser

' External recipients
Dim oExternalUsers : Set oExternalUsers = CreateObject("MFilesAPI.Strings")
oExternalUsers.Add -1, "khoendib@documentwarehouse.com.na"

Vault.NotificationOperations.SendCustomNotification oUsers, False, oExternalUsers, True, "Test email", "Test email body"

Parents Reply Children
No Data