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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Change body of email i...
Power Automate
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!
Categories:
  • Suggested answer
    Garima_PowerPlatform Profile Picture
    170 on at
    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,424 Super User 2026 Season 2 on at
    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 424

#2
11manish Profile Picture

11manish 328 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard