Script repository
The script sends an email notification containing all values of a multi-valued property. To execute the script, create a business rule, custom command or scheduled task configured for the required object type.
Parameters
$propertyName- the name of the property whose values will be included into the email notification.$to- the email address of the notification recipient.$subject- the email notification subject.$messageTemplate- a template of the email notification. In the template, the{0}placeholder will be replaced with values of the property specified in the$propertyNamevariable.
$propertyName = "adm-CustomAttributeTextMultiValue1" # TODO: modify me
# Email settings
$to = "recipeint@domain.com" # TODO: modify me
$subject = "Values of '$propertyName' property" # TODO: modify me
$messageTemplate = "Values: {0}" # TODO: modify me
# Get property values.
try
{
$values = $Context.TargetObject.GetEx($propertyName)
}
catch
{
$values = $NULL
}
if ($values -eq $NULL)
{
$values = "Not specified"
}
else
{
$values = [System.String]::Join("; ", $values)
}
# Build message
$message = [System.String]::Format($messageTemplate, $values)
# Send mail
$Context.SendMail($to, $subject, $message, $NULL)
Comments 0
You must be signed in to comment.