Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you are receiving emails that contain are sent from a system address with the a personal part containing that contains the actual sender address then you can use the following address to extract and . The script below will extract the actual sender address from the original personal part and will set this value from the name part as the sender of the email to be processed correctly.

Example Script:

Code Block
#set ($original = $taskUtils.getHeaderValue($message, "from").toString()) ##Extracts the Value found within the From header
#if ($original.contains("system@external.com"))  ##checks if sender address is a specific address
    #set ($address = $stringUtils.substringBetween($original, "(", ")")) ##Extracts the address from between the two brackets "("")"
    #set ($personal = $stringUtils.substringBetween($original, '"', "(")) ##Extracts the real senders personal part (Name)
    $message.setFrom('"' + $personal + '"' + "<"+ $address +">") ##Changes original from address to be the extracted name and email address
#end

...