Genesys Cloud CX (formerly PureCloud)

Discussion Thread View
Expand all | Collapse all

How To Extract Email Body Without Disclaimer

  • 1.  How To Extract Email Body Without Disclaimer

    Posted 06-15-2021 10:08
    Edited by SURESHKUMAR MAHALINGAM 06-15-2021 10:37
    Hi Team,

    Currently, I'm working on an Email channel. When customers are sending emails to us, we receive them with their organization's disclaimer.
    The disclaimer is in English language and but the customer messages are in Spanish, so the detectLanguage() is unable to return the language of the Email Body. May I know how to extract the email body without disclaimer in Architect?

    Please advise on this.

    Thanks in advance.
    #ArchitectureandDesign
    #AskMeAnything(AMA)

    ------------------------------
    Warm Regards,
    Sureshkumar.
    ------------------------------


  • 2.  RE: How To Extract Email Body Without Disclaimer

    Posted 06-15-2021 11:40
    Since there is no distinction between the actual email text and the disclaimer, the only way would be to read in the entire body, search for a keyword, then delete from that keyword until the end of the text with something like:  Right(Message.Message.body, FindString(Message.Message.body, "DISCLAIMER"))

    ------------------------------
    Robert Wakefield-Carl
    Avtex Solutions, LLC
    Contact Center Innovation Architect
    robertwc@avtex.com
    https://www.Avtex.com
    https://RobertWC.Blogspot.com
    ------------------------------



  • 3.  RE: How To Extract Email Body Without Disclaimer

    Posted 06-15-2021 12:33
    It works pretty. Thank you so much.

    ------------------------------
    Warm Regards,
    Sureshkumar.
    ------------------------------



  • 4.  RE: How To Extract Email Body Without Disclaimer

    GCAP Member
    Posted 9 days ago
    Hi Robert,

    I have a similar problem, all emails sent into our organization automatically get text added to the start of the email.

    EXTERNAL EMAIL - Use caution opening attachments and links.

    <o:p></o:p>This text will  cause incorrect language detection for emails in various languages
    Is there a way to keep only the text after this message and meanwhile also look at disclaimers at the end of the email?

    I did some testing with Left and Right on single words, but had unexpected results:
    Using Left I actually got all the text before the specified word.
    Using Right it skipped the enitre email and only provided the end of a signature. (tested this with multiple words and delivered similar result, up to just the final word or a few ... at the end of my email.

    I am trying to create a new variable with the cleaned body inside, however when it does not find the word the value will be a NULL value, so I also need to create a route to not change the body if the words are not found.

    Any help would be greatly appreciated,




    ------------------------------
    Gerben Duijster
    Becton Dickinson and Company
    ------------------------------