cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cb23
Helper V
Helper V

Creating text only message from large email for Teams

Hi there, 

 

This is a post in relation to a previous forum question (Re: Remove embedded images before forwarding e-mai... - Power Platform Community (microsoft.com)) - @VictorIvanidze I am following up!

 

What I am hoping to do is take an email from a certain address as a trigger and then post a message with the contents to a Teams channel. However, the emails are huge with loads of images (and breaches the message size limites), so if there is a way to just pull the text from the email and format it in a way that is still readable, that would be great to know. 

 

So far, I have tried taking the email and coverting to a pdf, but the amount of embedded images in the original html just make the document look messy, with lots of empty boxes as placeholders. If there is a better and easier way, I would love to know!

Thank you!

11 REPLIES 11
RobotRising
Helper V
Helper V

Hello @cb23 ,

 

You can use the html to text action. You would place the dynamic content body of the email into the html to text action and use the output of that action in your Teams action. 

 

2019-04-11_0952.png

 



--------------------------------------------------------------------
🌟 If I have helped give me a thumbs up! 👍
If I have answered your question, please mark it as solved

Nived_Nambiar
Super User
Super User

Hi @cb23 

 

To remove the images , we can try this approach, what i have seen is when converting html format of body to plain text, the image is converted to some naming like [cid: 123445] , after converting to plain text using convert to plain text action and then removing the [cid .... ] by new line approach if the images re added in new lines of email body like below:

Nived_Nambiar_0-1701706083617.png

 

 

See flow used:

Nived_Nambiar_1-1701706117408.png

 

Nived_Nambiar_2-1701706138757.png

 

Expression which split the output of convert html action based on new line

split(outputs('Html_to_text')?['body'],decodeUriComponent('%0A'))
 
Condition:
Nived_Nambiar_3-1701706186974.png

 

Use post message action to post message in teams :

Nived_Nambiar_4-1701706224911.png

 

Expression used here is to join text from filter array output to join as new line:

join(body('Filter_array'),decodeUriComponent('%0A%0A'))
 
Output of this process would be like this:
Nived_Nambiar_5-1701706275357.png

 

 

Hope it helps !

Thanks & Regards,

Nived N 🚀

LinkedIn: Nived N's LinkedIn
YouTube: Nived N's YouTube Channel

🔍 Found my answer helpful? Please consider marking it as the solution!
Your appreciation keeps me motivated. Thank you! 🙌

Hi @RobotRising, thanks for your reply. I get the following error details using this: 

{"error":"The payload is too large. Please make sure the size is less than 28KB."}

 

Also, I would like to keep the links of the email, I just don't want the images. Is that possible with the Html to text action? 

Hi Nived, 

 

Thanks for your reply. The original mailing list I tried had the same error as with the general HTML to text flow: {"error":"The payload is too large. Please make sure the size is less than 28KB."}

 

I tried your workflow with a different email which featured images and links, etc. and the flow ran and there was a message posted to Teams but it is virtually unreadable. It's just a lot of links within square brackets with plain text in between.

Is there a way to pull the formatted text - including links - from an email? And just leaving out the images? 

Hi @cb23 

 

Could you show how output from html to text looks like 

 

This would help in trying the logic on how to remove the extra square brackets within links 

 

Thanks & Regards,

Nived N 🚀

LinkedIn: Nived N's LinkedIn
YouTube: Nived N's YouTube Channel

🔍 Found my answer helpful? Please consider marking it as the solution!
Your appreciation keeps me motivated. Thank you! 🙌

Screenshot 2023-12-04 at 19.35.39.png

 

 

 Sure, here's one screenshot from PA and another from Teams where the message has been posted in a channel.

Hi @cb23 

 

May be you can try making a small change in my current flow within post a message action:

 

Nived_Nambiar_1-1701791677509.png

 

Expression: 

replace(replace(join(body('Filter_array'),decodeUriComponent('%0A%0A')),'[',''),']','')
 
Out you got:
 
Email used:
Nived_Nambiar_2-1701791748025.png

 

 

Post message in teams:

Nived_Nambiar_3-1701791778580.png

 

 
Thanks & Regards,

Nived N 🚀

LinkedIn: Nived N's LinkedIn
YouTube: Nived N's YouTube Channel

🔍 Found my answer helpful? Please consider marking it as the solution!
Your appreciation keeps me motivated. Thank you! 🙌

Thanks @Nived_Nambiar . It's better... but still not quite there. Long links are now hyperlinked! Still v hard to read.  Reluctant to post screenshot as I can see my email address buried in them. 

Hi @cb23 

 

Is it possible to show expected output, that would be helpful 🙂

Thanks & Regards,

Nived N 🚀

LinkedIn: Nived N's LinkedIn
YouTube: Nived N's YouTube Channel

🔍 Found my answer helpful? Please consider marking it as the solution!
Your appreciation keeps me motivated. Thank you! 🙌

@Nived_Nambiar I don't think it will ever look how I want because of the way that the email is put together with HTML elements. 

 

HOWEVER, I have had an alternative idea which I think would be a cleaner way to post to Teams and have the same end outcome. When I receive the email, there is always a link at the top saying 'Read online', which is linked to the newsletter online. So what about if I used PA to get this information and posted it with a pre-saved image (the same banner is always used) and the headlines? 

 

An example of the format is: 

[Aligned to the right] October 13th, 2023 | [hyperlinked] Read Online
[image - always the same so this could be pre-saved]
[headline]
[sub-heading]

 

Any ideas of how to use an expression to get this? 

 

Thank you! 

Hi @cb23 

 

Sorry for late response 

 

May be i am bit confused, could you clarify things properly 

 

Thanks & Regards,

Nived N 🚀

LinkedIn: Nived N's LinkedIn
YouTube: Nived N's YouTube Channel

🔍 Found my answer helpful? Please consider marking it as the solution!
Your appreciation keeps me motivated. Thank you! 🙌

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!    

Welcome to the Power Automate Community

You are now a part of a fast-growing vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun.   Now that you are a member, you can enjoy the following resources:   Welcome to the Community   News & Announcements: The is your place to get all the latest news around community events and announcements. This is where we share with the community what is going on and how to participate.  Be sure to subscribe to this board and not miss an announcement.   Get Help with Power Automate Forums: If you're looking for support with any part of Power Automate, our forums are the place to go. From General Power Automate forums to Using Connectors, Building Flows and Using Flows.  You will find thousands of technical professionals, and Super Users with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Automate community forums. Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered. Galleries: The galleries are full of content and can assist you with information on creating a flow in our Webinars and Video Gallery, and the ability to share the flows you have created in the Power Automate Cookbook.  Stay connected with the Community Connections & How-To Videos from the Microsoft Community Team. Check out the awesome content being shared there today.   Power Automate Community Blog: Over the years, more than 700 Power Automate Community Blog articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on the future of process automation. In the Power Automate Community Blog, you can read the latest Power Automate-related posts from our community blog authors around the world. Let us know if you'd like to become an author and contribute your own writing — everything Power Automate-related is welcome.   Community Support: Check out and learn more about Using the Community for tips & tricks. Let us know in the Community Feedback  board if you have any questions or comments about your community experience. Again, we are so excited to welcome you to the Microsoft Power Automate community family. Whether you are brand new to the world of process automation or you are a seasoned Power Automate veteran - our goal is to shape the community to be your 'go to' for support, networking, education, inspiration and encouragement as we enjoy this adventure together.     Power Automate Community Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Users online (3,239)