web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Flow: When email arrives V3 -> Post message in a Teams chat or channel. The message is one line.

(0) ShareShare
ReportReport
Posted on by 8

Hello, everyone,

 

I'm trying to figure out how to configure the flow to show the emails the way the arrive.

 

The email I receive looks like this:

 

Line 1

Line 2

Line 3

Line 4

Line 5

Here is the "Inspect element" of the email body:

ivos_0-1711470852093.png


When the flow gets triggered a message is sent to a Teams group chat but it looks like this

 

Line1 Line2 Line3 Line4 Line5

 

How can I fix that?

 

I have the same question (0)
  • v-yueyun-msft Profile Picture
    on at
    Re: Flow: When email arrives V3 -> Post message in a Teams chat or channel. The message is one line.

    Hi , @ivos 

    I test it in my side , it works good. 

    This is my email body:

    vyueyunmsft_0-1711502570017.png

    And this is my flow:

    vyueyunmsft_1-1711502581604.png

    The end result is as follows:

    vyueyunmsft_2-1711502633796.png

     

     

    Best Regards,

    Yueyun Zhang

  • ivos Profile Picture
    8 on at
    Re: Flow: When email arrives V3 -> Post message in a Teams chat or channel. The message is one line.

    Hey @v-yueyun-msft

     

    Thank you for replying.

     

    I also had the same flow but it was not working how I wanted it to.

     

    The difference between your email and the email I receive is in the HTML element.

    If you inspect the body of your email, you will see that each line is a <div> while the lines in my email are done with <br> tags


    Here is the email body and the inspect element of it when I sent an email from my personal email address

    ivos_0-1711549263696.pngivos_1-1711549266720.png



    Here is the "inspect element" of the email body that one of our systems is sending to us:

    ivos_2-1711549328747.png

     

  • v-yueyun-msft Profile Picture
    on at
    Re: Flow: When email arrives V3 -> Post message in a Teams chat or channel. The message is one line.

    Hi , @ivos 

    I directly use the same html code in the "Post message in a chat or channel".

    vyueyunmsft_0-1711591142489.png

    And the it still have the line breaks like this in teams:

    vyueyunmsft_1-1711591200263.png

     

     

    Best Regards,

    Yueyun Zhang

  • ivos Profile Picture
    8 on at
    Re: Flow: When email arrives V3 -> Post message in a Teams chat or channel. The message is one line.

    Hey @v-yueyun-msft,

     

    Thank you so much for continuing to look into this.

     

    I performed some tests today.

     

    This is my flow:

     

    ivos_0-1711634221250.png


    Test 1: When I receive an email from "S" (one of our systems) the body and the HTML element look like this:

    ivos_2-1711634275175.png

    The message I receive on Teams is on 1 line:

    ivos_3-1711634570568.png

    ivos_4-1711634868787.png

     

    Test 2: When I forward the email from "S" I get a totally different result:

     

    ivos_5-1711635001295.png

    ivos_6-1711635064763.png


    The result in Teams is as expected - on different lines

    ivos_7-1711635183267.png

     

    Can you help me understand why this is happening and how to resolve it?

  • v-yueyun-msft Profile Picture
    on at
    Re: Flow: When email arrives V3 -> Post message in a Teams chat or channel. The message is one line.

    Hi , @ivos 

    This strange... Can you check what's the difference between the output of the "When a new email arrives" trigger in your flow run history.

     

    Best Regards,

    Yueyun Zhang

  • ivos Profile Picture
    8 on at
    Re: Flow: When email arrives V3 -> Post message in a Teams chat or channel. The message is one line.

    Hey, @v-yueyun-msft,

     

    Here is the first one:

     

    {
     "body": {
     "id": "EncryptedGMxMGQ5LWIyYWEtNDNiMy1hZjgxLTdmN2JiZTQ3ZmRiOQBGAAAAAAC05PNNtUx4RZZapu683SWHBwC_zY0BP73cQoNT2Vub2aN1AAIvcMDJAAC_zY0BP73cQoNT2Vub2aN1AAI2BcENAAA=",
     "receivedDateTime": "2024-03-28T13:44:48+00:00",
     "hasAttachments": false,
     "internetMessageId": "\u003Cour_system@email.com\u003E",
     "subject": "Subject",
     "bodyPreview": "Line 1\r\n\r\nLine 2\r\n\r\nLine 3\r\nLine 4\r\nLine 5\r\nLine 6",
     "importance": "normal",
     "conversationId": "EncryptedGMxMGQ5LWIyYWEtNDNiMy1hZjgxLTdmN2JiZTQ3ZmRiOQAQAE92m4o9-DdErJP76zk7JFs=",
     "isRead": true,
     "isHtml": false,
     "body": "Line 1\r\n\r\nLine 2\r\n\r\nLine 3\r\nLine 4\r\nLine 5\r\nLine 6\r\n\r\n\r\n",
     "from": "our_system@email.com",
     "toRecipients": "my@email.com",
     "attachments": []
     }
    }

    And the second one:

    {
     "body": {
     "id": "EncryptedMxMGQ5LWIyYWEtNDNiMy1hZjgxLTdmN2JiZTQ3ZmRiOQBGAAAAAAC05PNNtUx4RZZapu683SWHBwC_zY0BP73cQoNT2Vub2aN1AAIvcMDJAAC_zY0BP73cQoNT2Vub2aN1AAI2BcEMAAA=",
     "receivedDateTime": "2024-03-28T13:42:04+00:00",
     "hasAttachments": false,
     "internetMessageId": "\u003Cmy@email.com\u003E",
     "subject": "Subject",
     "bodyPreview": "Line 1\r\n\r\nLine 2\r\n\r\nLine 3\r\nLine 4\r\nLine 5\r\nLine 6",
     "importance": "normal",
     "conversationId": "EncryptedGMxMGQ5LWIyYWEtNDNiMy1hZjgxLTdmN2JiZTQ3ZmRiOQAQAEyiIyV3ZaZGqU3P4UgyDUY=",
     "isRead": false,
     "isHtml": true,
     "body": "\u003Chtml\u003E\u003Chead\u003E\r\n\u003Cmeta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"\u003E\u003Cstyle type=\"text/css\" style=\"display:none\"\u003E\r\n\u003C!--\r\np\r\n\t{margin-top:0;\r\n\tmargin-bottom:0}\r\n--\u003E\r\n\u003C/style\u003E\u003C/head\u003E\u003Cbody dir=\"ltr\"\u003E\u003Cdiv class=\"elementToProof\" style=\"font-family:&quot;Segoe UI&quot;,&quot;Segoe UI Web (West European)&quot;,&quot;Helvetica Neue&quot;,sans-serif; font-size:11pt; color:rgb(0,0,0)\"\u003E\u003Cspan style=\"color:rgb(0,0,0)\"\u003E\u003C/span\u003ELine 1\u003Cbr\u003E\u003Cbr\u003ELine 2\u003Cbr\u003E\u003Cbr\u003ELine 3\u003Cbr\u003ELine 4\u003Cbr\u003E&Line 5\u003Cbr\u003ELine 6\u003Cbr\u003E\u003Cbr\u003E\u003Cbr\u003E\u003C/div\u003E\u003C/body\u003E\u003C/html\u003E",
     "from": "my@email.com",
     "toRecipients": "my@email.com",
     "attachments": []
     }
    }
  • ivos Profile Picture
    8 on at
    Re: Flow: When email arrives V3 -> Post message in a Teams chat or channel. The message is one line.

    Hey @v-yueyun-msft,

     

    Was that the information you were looking for?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard