Highlighted
Trusted Contributor.
Trusted Contributor.
430 views

Mail body trim in inbound email integration

Jump to solution

Hi All,

We have done an email integration to create a ticket in HP Service manager and we tickets re getting created successfully.

We have mapped Email Body to Description (Action) field, now entire email body (appended email including earlier FW/ RE) is getting captured in the that customer do not want.

it is like latest mail body should be tagged in the description rest everything to be removed.

in the attached screen Shot, mail body should be ignored after From: (Highlighted).

It would be great help if someone can help with the script to achieve this.

 

Thanks,

VND

0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Mail body trim in inbound email integration

Jump to solution

Use this commands, to cut what you needed.

RightPart()

Syntax - Function RightPart(strFrom As String, strSep As String, bCaseSensitive As Long) As String

Description - Extracts the portion of a string to the right of the separator specified in the strSep parameter. The search for the separator is performed from right to left. The search can be made case sensitive using the bCaseSensitive parameter.

Input parameters

  • strFrom: Source string to be processed.
  • strSep: Character used as separator in the source string.
  • bCaseSensitive: Depending on this parameter, the search is case sensitive (=1) or not (=0).

 

Example:

LeftPart("This_is_a_test","_",0)

Returns This.

LeftPartFromRight("This_is_a_test","_",0)

Returns This_is_a.

RightPart("This_is_a_test","_",0)

Returns test.

RightPartFromLeft("This_is_a_test","_",0)

Returns is_a_test.

Mapping script for you may be next:

 

Dim Result as string
Result = ""
Result = LeftPart([body],"From:",0)
RetVal = Result

or

RetVal = LeftPart([body],"From:",0)

 

View solution in original post

5 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Mail body trim in inbound email integration

Jump to solution

there is no screenshot.

Do you use "Connect It" for email intergrations ?

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: Mail body trim in inbound email integration

Jump to solution

Hi Thanks for your reply.

Yes it is using connect IT.

Not sure eventhough i am attaching jpeg/png i am not able to attach.

Below is the sample email

To:servicedesk

Subject System not working

Please create ticket, system not working.

 Thanks,

 ------------------------------------------------------------------------

From: HPE Community Admin
Sent: Wednesday, April 12, 2017 3:55 PM
To: xxxxxxxxxxxxxxxxxxx
Subject: You have earned a badge for reading 30 Messages

 

 Expection is it should trim entire mail body from the appended email starting from "From:" key word.

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Mail body trim in inbound email integration

Jump to solution

Use this commands, to cut what you needed.

RightPart()

Syntax - Function RightPart(strFrom As String, strSep As String, bCaseSensitive As Long) As String

Description - Extracts the portion of a string to the right of the separator specified in the strSep parameter. The search for the separator is performed from right to left. The search can be made case sensitive using the bCaseSensitive parameter.

Input parameters

  • strFrom: Source string to be processed.
  • strSep: Character used as separator in the source string.
  • bCaseSensitive: Depending on this parameter, the search is case sensitive (=1) or not (=0).

 

Example:

LeftPart("This_is_a_test","_",0)

Returns This.

LeftPartFromRight("This_is_a_test","_",0)

Returns This_is_a.

RightPart("This_is_a_test","_",0)

Returns test.

RightPartFromLeft("This_is_a_test","_",0)

Returns is_a_test.

Mapping script for you may be next:

 

Dim Result as string
Result = ""
Result = LeftPart([body],"From:",0)
RetVal = Result

or

RetVal = LeftPart([body],"From:",0)

 

View solution in original post

Highlighted
Trusted Contributor.
Trusted Contributor.

Re: Mail body trim in inbound email integration

Jump to solution

Hi,

 

Thanks a ton!!! for your details description of the script. i have applied the same it is working as expected.

can you also help me with sample script to read first 10 lines of email body.

Thanks in advance,

VND

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Mail body trim in inbound email integration

Jump to solution

you need to create new post with your issue.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.