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.