Why is HTML body messed up in Power Automate send email v2 ?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello inside power automate we have an action called send an email V2 and I'm pretty sure 99.8% of you have already used this control it's fantastic it sends email it can CC it can accept attachments it can send email as HTML it can use shared mailbox all those good things but unfortunately unfortunately it has a feature which is Rich Text Editor for the email body and I wish it was not there in this video I want to show you how that tiny thing can mess up your email and disorganize your HTML however you put it in there and we also see how we can avoid it enjoy the video I try to make a very simple scenario to show you how this problem can cause some disasters when you are delivering the project or you are making some minor changes I created the simplest flow that could show you what's going on here and in this case it is a manual flow that accepts a search word and then sends an email at the moment it just has a dummy subject like test subject and a body which is technically empty if I just save it and run it I can test it manually and it sends an email continue and test at the moment it doesn't really matter because it doesn't do anything with this string and I say done and as you can see if I go back to my mailbox you will see this email here nothing special now let's go back to something that may really happen in the real life to show you the issue I made up some scenario myself let's say you go to Google and and search for the word dkey if you press enter first Google generates a search string or a search URL like this so whatever the Google address is it says slash search question mark Q equals your search string and then redirects you to this URL and you will see the result so now in our scenario we want our flow accepts this search string generates this URL and sends this URL to a user as email so here my email should contain something like this https column sl/ google.com/ search question mark Q equals whatever that comes from here which is my search word and I can save it let me test it again and this time I'm searching for dony and I click on run flow done and here is the email if I just copy it open it you will see something like this so the link is generated perfectly fine we're good now let's play with it and make it a little bit fancier as we should using the HTML Tex so let me start by subject let's say I call it search link for whatever that comes from here which is my search word there we go then I can come here while I have this string I can make it fancier and I can say dear sir here is the link to Google your requested keyword and then I want to go to the next one and I want to say no this is not just a plain URL I want to make it something fancier let me just take it out and I say click here to find search result for whatever the search word that comes from here so now if I save and run it that's going to look a little bit better like this again my donkey and I click on run flow done and let's check the email now all right this is better now the only thing that we need to do we need to convert this one to a hyperlink now if I go back inside flow I can select a text and I can make it a hyperlink the only problem is that the target link is going to be something fixed so I cannot put my search word or a dynamic value as a Target link or even putting it in a variable doesn't do the job because here it just accepts some static text unless we click on this guy here which takes us to the HTML view of this email and this is the cause of all the problems that we may have let's do it so here I can say a for the hyperlink and I can close this piece by slash a for the HTML tag I come right in the beginning and I say HRA which is going to be my hyperlink double code double code and in between I put my Google link and we're good right let me save it and see how we can test it manually I can say my donkey again and I click on run flow done fantastic we got it you know what let me click on it and see what we get beautiful the email is fantastic what else can you expect now let me show you what the problem is let's go back to edit I can go out of it you're good but next say your client says you know what I want this donkey to be bold for example so we said no problem if we come back here we open this guy I click on edit and I expand it and yes here is your disaster because all of a sudden it messed up everything I click on here and you will see all of of a sudden because it switched it to the HTML view it messed up with quite a few of your texts even if I don't touch it and if I just save it now keep that in mind I didn't change anything I click on test and I click on manually run the floow again my donkey and I click on run floow think about it I didn't change anything this is my message see the beauty it messed up the entire thing I didn't do anything I just open the email and closed it now this can be an email with lots of customizations Styles and all those things you just save it and you open it again and everything is messed up that's why I say if you're dealing with any Dynamic content never use this code view here inste create a variable initialize variable and I call it vcore email body type is going to be a string and whatever that was supposed to go here as of HTML let me just copy everything here bring it here and then instead of all these tags and text and everything else that you have here just come back here and insert the body here when you do it like this send email V2 does not change anything now here you can comfortably put all your HTML thingy and and let me see if I can fix this guy now here is the link I don't need this piece anymore this is just a junk that it added okay so right after this it's going to be here is going to be my open a tag here is going to be my edre equals yeah this is my edre actually I can take it from here up to QBE all right I don't need this one anymore here is my search I need my double code as the closing for the edre and after that I close the angular bracket and I don't need this extra hyperlink tag anymore very good the only thing is that this text should come between this opening and closing text looks okay to me the main thing is that as soon as you create the HTML here if you just copy it and put it in a variable and then bring this variable inside the send email V2 everything is good so let's save it test this time again I search for my donkey and I click on run flow done and here is my new email and as you can see it is still missing the search word I can come back here no problem the main thing is that if I just get out of this and I come back inside it again the initialize variable in a string variable doesn't mess up anything so string 4 I can put my search string right here click and I just save it again and because inside send email V2 there is no weird HTML tags or anything else like that it doesn't do anything and you can make your updates happily ever after and this is the last one for donkey and I click on run flow done and here is my email that I can click on it and see my beautiful donkey so always always always put your email body constructed in a separate variable and then just bring that variable inside the send email V2 body all right I have been aware of this issue and trust me even today I make this mistake and I start putting the HTML tags inside the send email V2 it's normal and the reason is that quite often we start email with something very simple then we take it for the client review they say oh you know what how about adding a link here how about adding this here how about adding that here how about changing this style here and when these things happen we are opening the can of warm for a disaster I hope this video helps you at least keep that in mind that this is the case so until Microsoft releases the send an email V3 without this problem uh we know how to deal with it thank you for watching and I'll see you in the next [Music] video [Music]
Info
Channel: Alireza Aliabadi
Views: 5,117
Rating: undefined out of 5
Keywords: why html messed up in send email v2, Power automate tips, send an e-mail v2, send an e-mail v2 bug, send an email v2 html issue, send an email v2 messed up html, send an email v2 power automate, send an email messed up body, email body html changed, send email v2 body changed, power automate messed up html email, Why is HTML body messed up in Power Automate send email v2
Id: DzLsY9WvRnw
Channel Id: undefined
Length: 12min 14sec (734 seconds)
Published: Tue Oct 10 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.