4 Replies Latest reply on Aug 14, 2018 7:38 AM by PBeard1

    Determine Which Email Listener created the Journal.Email record

    PBeard1 Apprentice

      Hello Team, we have a
      unique scenario here at OSFI with regards to Email Listeners.

      Background: ( I will try my best to explain… it’s
      a unique situation)

       

      We have 3 different sections
      using HEAT to manage their requests with record segregation (so they cant see
      each others requests and emails)

      ITSD:

      Security:

      Facilities:

      Each section has their
      own email listener ( The listener does not create an incident, emails go into an
      Email Triage object in which the Agents will either spawn an incident or
      request from it) . All works just fine when an email is sent exclusively to 1
      listener, BUT, it is very common for an email to be send to more than one of
      the listeners above.

      I:E. in the To:  field, it contains all 3 listener address’s.  When an email comes in, I have a before save
      calculation rule that evaluates the To and the CC, and if it finds the
      respective address, it sets a Boolean field, which then enables visibility of
      that email for the respective role. Also, each listener will create a
      Journal.Email record for the email it found in its inbox ( which can also be
      fine if….see below). Initially I had this as a single text field that would
      insert which Role it is visible too but then the scenerio arose where it is
      common for a single email to be sent to multiple listeners address so each role
      would need to see this email.

       

      The issue they are
      having is when this scenario arises, each listener pics up the email it found
      in their inbox and creates the Email Record, my before save calculation evaluates
      the To:  and CC: and sets those Booleans to
      true on all 3 Journal.Email records, which in turn causes the email to show up
      multiple (up to 3 if all address where in the To/CC) in each groups email triage
      bucket.

       

       

      Is there a simple way
      to determine which Email Listener created the Journal.Email record? If there is
      this would resolve ALL our issues here!!!

      I see if we select Incident
      as the processor and I check of ‘Include Source Email Name’ it is ‘Supposed’ to
      set the createdby value to the address the listener is listening on. ( Did a
      quick test and it still showed InternalServices as the createdby)

      Also we do not want
      every email to create an incident so I can’t even use this feature anyways.

       

      Here is a sample of ( see attachment)
      what happens when I include 2 of the email listener address’s on a single
      email, as you can see it doubles it up

        • 1. Re: Determine Which Email Listener created the Journal.Email record
          Jonathan.Schmidt SupportEmployee

          Hi Paul,

           

          Are you using the XSLT processor?  If so you might be able to pull some kind of unique Identifier out of the Email message like an outlook message ID and store it in your Email triage object.  Making it unique would then prevent the extra copies from being made.  I'd also think you'd need to move the "which department should this route to" logic into the XSLT transformation and set up case switches for which dept gets priority if multiple departments were in the recipients.

           

          Short of that the next best way to go would be exchange server rules that would only deliver such emails to one of the boxes.  I'm not sure if that's even feasible though.  The exchange admin probably wouldn't like it much even if it is, but it's a logical approach from a 50000 feet sort of thought process.

           

          Jon

          • 2. Re: Determine Which Email Listener created the Journal.Email record
            dcogny Expert

            I am replying to a message that was deleted (I assume that the poster realized that the solution would not work, because he was recommending to use the "Include Source Mailbox Name" option), I am still posting this as it can expand the request from OP:

             


             

            I have the same problem and that does not work. The problem is that we do not create an Incident from an Email, we have the system create an "Email" object and then we have our Analysts triage them:

             

            All mails get created by "InternalServices", so ticking that "Include Source Mailbox Name" does nothing. It works, I tested by creating Incidents instead of Emails, and there I can see the mailbox in the "CreatedBy",  but using Incidents now would force us to change our whole procedure and would become a reporting nightmare. The question is, it there is any option to add the mailbox from where is coming when creating a new object?, how HEAT transfers the Subject from the email to the "Subject" of the Email object and the Body to the Body?. If we can learn that then we could add something to store the Mailbox.

             

            In my case the problem is that sometimes we receive emails as BCC, and there is no easy way to manage those ones, they end up going to the Help Desk triage Dashboard, but they might be meant for HR or Finance, and that creates some privacy concerns.

             

            Thanks for your help.

             

            Daniel.

            • 3. Re: Determine Which Email Listener created the Journal.Email record
              crispr_bacon Apprentice

              After going over your document, I saw you had already explored using the option I suggested.

               

              Here is a basic XML Payload from an email with nothing in the body. You have To, CC, and BCC fields you can work off of. As previously suggested, you may be able to build an XSLT file to work out assignment logic based on the values seen in those fields.

               

              You may not even need to go that far, you could just edit the XSLT to include the listener name to a field. Since the payload includes the Recid of the mail item it created, you should be able to use that unique value to update the email with the needed values in the same XSLT.

               

              About Hierarchical XML Format

              i.e.

               

                  <BusinessObject Name="Journal.Email">

                      <Transaction>UpdateAdd</Transaction>

                      <UniqueKeyList>

                          <UniqueKey>

                              <Field Name="RecId" />

                          </UniqueKey>

                      </UniqueKeyList>

                      <FieldList>

                          <Field Name="Source">Email Listener 1</Field>

                          <Field Name="RecId">58A417970BD64D6D90351E7EC65E0609</Field>

                      </FieldList>

               

               

              <?xml version="1.0" encoding="utf-8"?>

              <BusinessObjectList SchemaVersion="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="HierarchicalObjects-1.0.xsd">

                 <BusinessObject Name="">

                    <EmailMessage>

                       <MessageID>c9b0b425-5e00-4dab-8271-cc83a90f28e4</MessageID>

                       <From>[email protected]</From>

                       <Header>

                          Return-Path: [email protected]

                          Received: from [127.0.0.1] (ism.local [127.0.0.1]) by SERVER2012R2 with ESMTPA ; Tue, 7 Aug 2018 17:22:33 +0000

                          To: [email protected]

                          From: "Flycast" &lt;[email protected]&gt;

                          Subject: Test 20180807 1722

                          Message-ID: &lt;[email protected]&gt;

                          Date: Tue, 7 Aug 2018 17:22:33 +0000

                          User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

                          MIME-Version: 1.0

                          Content-Type: text/plain

                          Content-Transfer-Encoding: 7bit

                          Content-Language: en-US

                          Cc:

                       </Header>

                       <ReplyTo />

                       <Sender />

                       <To>[email protected]</To>

                       <CC />

                       <BCC />

                       <TimeStamp>8/7/2018 5:22:33 PM</TimeStamp>

                       <BlockCount>0</BlockCount>

                       <Subject>Test 20180807 1722</Subject>

                       <SubjectID />

                       <Body />

                       <BodyHTML />

                    </EmailMessage>

                    <RelatedBusinessObjectList>

                       <RelatedBusinessObject Relationship="">

                          <BusinessObject Name="Employee">

                             <Transaction>None</Transaction>

                             <LinkTransaction>None</LinkTransaction>

                             <UniqueKeyList>

                                <UniqueKey>

                                   <Field Name="PrimaryEmail" />

                                </UniqueKey>

                             </UniqueKeyList>

                             <FieldList>

                                <Field Name="RecId">06095C36D0574BE79A57BC5645F8C578</Field>

                                <Field Name="PrimaryEmail">[email protected]</Field>

                             </FieldList>

                          </BusinessObject>

                       </RelatedBusinessObject>

                       <RelatedBusinessObject Relationship="">

                          <BusinessObject Name="Journal.Email">

                             <Transaction>None</Transaction>

                             <LinkTransaction>Link</LinkTransaction>

                             <UniqueKeyList>

                                <UniqueKey>

                                   <Field Name="RecId" />

                                </UniqueKey>

                             </UniqueKeyList>

                             <FieldList>

                                <Field Name="RecId">58A417970BD64D6D90351E7EC65E0609</Field>

                             </FieldList>

                          </BusinessObject>

                       </RelatedBusinessObject>

                    </RelatedBusinessObjectList>

                 </BusinessObject>

              </BusinessObjectList>

              • 4. Re: Determine Which Email Listener created the Journal.Email record
                PBeard1 Apprentice

                Hi Crispr_Bacon, Thanks for your response! All I am really after is to set a Boolean field to true on the journal.email record it creates. I have been trying to get the XSLT scripted to do so with no luck yet.

                This is the only transformation I need to occur is:

                <xsl:element name="Field">

                          <xsl:attribute name="Name"><xsl:text>isITSD</xsl:text></xsl:attribute>

                          <xsl:text>1</xsl:text>

                </xsl:element>

                 

                I notice when no xslt is applied (or an xslt that has issues) it will still creates the journal.email record so the mapping/translation of the main fields occurs without the xslt, I am assuming the mechanism that generates the xml from the email uses the same column names as the OOB journal.email so mapping in the xslt is not necessary for those fields.

                 

                Thanks again for your help

                Paul B