Configuring addressing options

With the EmailPlus package, you can address emails by identifying fields that are a reference or a reference list to users.

The package also searches referenced record types for such references, but a configuration item limits the depth of recursion. By default, EmailPlus searches these records:

  • Current record
  • Child records of the current record
  • Child records of the child records of the current record

To change this depth, you must define a constant in the EMP_Customisable Perl global script. For example, setting the value of the $MAX_FIELDPATH_RECURSE_DEPTH constant to 2 sets the depth of recursion to two: the child record and the child records of the child records of the current record. Setting the value of the $MAX_FIELDPATH_RECURSE_DEPTH constant to 0 limits the search to the current record. Setting the value to 3 searches child records up to the third level, in addition to the current record.

Another way to widen the kind of fields that are searched for is to use the $FIELDPATH_INCLUDE_STRINGS constant, which makes EmailPlus include all string fields that are discovered in records at any depth of recursion. You must determine whether the selection includes only fields that contain lists of valid HCL Compass User IDs that are specified one to a line or are separated by commas. Otherwise, the results are undefined.

Define these constants in the EMP_Customisable Perl global script with GLOBAL SCOPE, not inside a function or subroutine. For example, define the constants according to this code:

	# Start of Global Script EMP_Customisable
	# The routines in the module are customisable. 
	
	$MAX_FIELDPATH_RECURSE_DEPTH = 2;
	$FIELDPATH_INCLUDE_STRINGS = 1;
	
	sub EMP_SubstituteCustomMetaTag {
	  my $metaTagParts_ref = shift; # a reference to an array
	  my $entityDefObj    = shift;
	  my $isHTMLContent   = shift;
	  my $isTest          = shift;
	….
If these constants are not defined, the package adopts the following default behavior:
  • Using only the User fields of type Reference To Users to determine email addresses
  • Searching to a depth of recursion of 2 to identify the fields to use to determine the email addresses