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
Answered

Change body of email in a flow

(0) ShareShare
ReportReport
Posted on by 14
Hey guys!
 
So I am trying to find a way for email bodies to be posted in a channel but go to the Teams default for font color as currently the body only looks good in light theme on Teams and looks awful in dark theme.
 
These emails will contain images if that helps at all.
 
Super simple flow setup for it currently:
 
 
This is what it currently looks like when posted in dark theme:
 
It would be great too if someone knew how to take out things from a body in Power Automate prior to being sent out too like, "You don't often get email from noreply@smileback.com. Learn why this is important"
 
And yes I do know SmileBack has a built in Teams Integration. Its been broken for months for us without any useful help for CW.
 
This is what the body of the emails will look like if it helps:
 
 
Thank you as always!
I have the same question (0)
  • Suggested answer
    Garima_PowerPlatform Profile Picture
    170 on at
    Change body of email in a flow
    Hi

    To ensure email bodies are posted in a Teams channel while maintaining the default font color across both light and dark themes, you can use a few strategies. Additionally, removing unwanted text such as “You don't often get email from noreply@smileback.com. Learn why this is important” can be done before sending.

    Steps to Handle Emails for Teams:

    1. Standardize Font Colors in Teams

    • Teams automatically applies a consistent font style and color based on the theme (light or dark). However, for email body content, we can ensure the formatting of images and text appears well across both themes.

    2. Removing Specific Text from Email Body

    In Power Automate, you can manipulate the email content to remove unwanted text, ensuring the email body displays cleanly.
     

    Extract Email Body Content:
     
    {
        "name": "Extract_Email_Body",
        "inputs": {
            "HtmlContent": variables('emailBody')
        }
    }
     
    Remove Unwanted Text:
    {
        "name": "Remove_Unwanted_Text",
        "inputs": {
            "HtmlContent": variables('emailBody'),
            "XPath": "//*[text()[contains(., 'You don't often get email from noreply@smileback.com. Learn why this is important')]]",
            "ReplacementText": ""
        }
    }
    Ensure Consistent Formatting:
     
    {
        "name": "Format_Email_Content",
        "inputs": {
            "HtmlContent": variables('cleanEmailBody'),
            "CSS": "padding: 10px; text-align: center;"
        }
    }
    Send the Formatted Email Body to Teams:
    {
        "name": "Post_to_Teams_Channel",
        "inputs": {
            "ChannelId": teams('desiredChannelId'),
            "Message": variables('formattedEmailBody')
        }
    }
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
     
  • Verified answer
    MarkRahn Profile Picture
    1,125 Super User 2025 Season 2 on at
    Change body of email in a flow
    Hi,
     
    I took a look at this because I thought you might be able to put a tag around the Body to control the formatting. It didn't quite work.
     
    The simplest thing I found was to do something like this where you convert the HTML to text and replace the line feeds with "<br>":
    replace(outputs('Html_to_text')?['body'],variables('LineFeed'),'<br>')
     
    I had to make a variable for the linefeed. Using '\r\n' or '\n' was not working for me.
     
    This doesn't get you exactly what you are looking for but it might get you close. I don't have the exact body of one of these emails, but you may be able to use the technique I described to get close.
     
    For any images in the body, I'm not sure how the "HTML to text" Action will handle those. It may strip them out. Since you are only looking at positive feedback, you may be able to hard code a smiley face as an image or 😊 emoji
     
    Because you mentioned that the ConnectWise Teams integration does not work, I went and looked to see if a ConnectWise Connector for Power Automate exists. I did find this: https://www.youtube.com/watch?v=2IShcFN4mzA
     
    This might allow you to create a trigger that is fired from ConnectWise.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
     
    Thanks -Mark
     

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 614 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 401 Moderator

#3
chiaraalina Profile Picture

chiaraalina 282

Last 30 days Overall leaderboard