cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Format HTML Email Body

Hello People,

 

Hope someone will be able to help me here.

 

Background :

 

1. Get emails received in last 7 days from google alerts, merge it into one email and send it

2. We add disclaimer to external emails we receive in a HTML format, I would like to remove it using Power Automate along with some other content which I receive in the email body (Eg :- Unsubscribe, Send Feedback)

 

Current Status :

 

1. I am able to achieve the first part, however couldn't find a way to edit HTML content.

It would be great if someone could show some light here...!

1 ACCEPTED SOLUTION

Accepted Solutions
Shujaath_Khan
Super User
Super User

Hi @issac_franklin 

 

did you try to use replace expression and strip the HTML tag from each mail body like

replace(variables('testMailBody'),'<a href="https://example.com"> Unsubscribe </a>','')

 

Thanks

 

View solution in original post

5 REPLIES 5
Shujaath_Khan
Super User
Super User

Hi @issac_franklin 

 

did you try to use replace expression and strip the HTML tag from each mail body like

replace(variables('testMailBody'),'<a href="https://example.com"> Unsubscribe </a>','')

 

Thanks

 

Hello @Shujaath_Khan 

 

Thank you for your input.

 

What you have suggested has worked.

Muthu_VIjayan
Frequent Visitor

I have a requirement for coloring a particular column in HTML table with 3 different cell background color based on cell value.

The source is from List rows from a excel table and the table which will be dynamic based on people update

Need your guidance and support to crack this logic for coloring a particular status column

Not started --> Red

In- Progress --> Yellow

Completed --> Green

Please explain with the Power automate connectors and expression screenshots where we are inputting the logic for cell Background colors based on cell value

Hi @Muthu_VIjayan 

 

Now assume you've the HTML body ready and you want to style particular <td> cell

you can try below

 

replace(variables('testMailBody'),'<td>Not started</td>','<td bgcolor="red">Not started</td>')

 

similarly for others as below

<td bgcolor="green">Completed </td>
<td bgcolor="red">Not started</td>
<td bgcolor="yellow">In- Progress</td>

 

P.S. Make sure the replace is able to find the tag properly for <td>Red</td>

Thanks

Hi @Shujaath_Khan 

 

Where i need to input these in power automate?

Can you share one sample screenshot of power automate flow which send a email with HTML table?

And where i need to add these styling?

 
 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,099)