Hello Simone,
Sure, here is an example of the script. In the script:
- $multiValuedPropertyName - Specifies the LDAP name of the multivalued property.
- $separator - Specifies the separator for values of the property in the email notification.
- $to - Specifies the address of the email notification recipient.
- $subject - Specifies the subject of the email notification.
- $messageTemplate - Specifies the email notification template. In the template, the {0} and {1} placeholders will be replaced with the property LDAP name and its values accordingly.
$multiValuedPropertyName = "adm-CustomAttributeTextMultiValue1" # TODO: modify me
$separator = ";" # TODO: modify me
# Mail settings
$to = "recipient@domain.com" # TODO: modify
$subject = "My Subject" # TODO: modify
$messageTemplate = @"
Hello,
Here are values of property {0} for user %fullname%:
{1}
"@ # TODO: modify
# Get property values
try
{
$valuesArray = $Context.TargetObject.GetEx($multiValuedPropertyName)
}
catch
{
$Context.LogMessage("Property $multiValuedPropertyName is empty.", "Warning")
return
}
# Send mail
$values = [System.String]::Join($separator, $valuesArray)
$message = [System.String]::Format($messageTemplate, @($multiValuedPropertyName, $values))
$Context.SendMail($to, $subject, $message, $NULL)