Mail body trim in inbound email integration

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

  • there is no screenshot.

    Do you use "Connect It" for email intergrations ?

  • 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.

  • Verified Answer

    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)

     

  • Verified Answer

    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)

     

  • Verified Answer

    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)

     

  • 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

  • you need to create new post with your issue.