Power Apps MailTo - Open a new email with values by pressing a button

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in today's quick thursday tip we're going to talk about powerapps mail two links so the idea of a mail to link is instead of having powerapps send the email when you press the button what it's going to do is it's going to open up the user's email client like outlook this works on their desktop their tablet their phone it doesn't matter whatever the default mail client is it'll pop open you can pre-populate things for them but then they can still edit them like any email and then send it we just want to send more emails but before we learn about that first here's our intro hi my name is shane young with powerapps911 those guys and today we'll talk about powerapps mail two links mail two links is just an html concept where you can preform a string and when you use the powerapps launch function with a button so on the on select property then what you're going to do is it's going to launch their local default mail client so whether it's outlook or some other janky things lotus notes is something i used a million years ago whatever it might be it will launch your default mail client and it's going to work on any type of device and then they can go ahead and modify the email you can pre-populate it with the two the cc the bcc the subject to body or you could just open up a blank email let them fill it all out whatever you want to do the world is your oyster so i thought this was a great quick little tip to get you guys going so let's just switch over to my desktop and let's build this real fast so over here on my desktop this is the last um email like i did a full feature thing on how to build outlook emails and send them straight from powerapps but it's not we're gonna do but i just thought it was a nice addition to this app so that's why i busted this app open so what i have here is if i click on this launch outlook button you're gonna see that an email pops open in my outlook client look at that it knows who it was 2 the cc the bcc the subject the body all of that from just pressing a button and so then i can modify this any way that i want and ship it out pretty cool so how does that work it's pretty straightforward actually so if we go over here and we take a look at our button we're going to see that i'm using the powerapps launch remember launch is a great function because it just says hey operating system here's something i want you to go open and so this might work for mail to link like this we use this a lot with http links so a url so i want to send them somewhere or you know if i want to open like pdfs and things i'm always using the launch function and so in this case we're going to do is we're going to craft out some email right so we're gonna say mail two and so it's mail two cola notice it's all in quotes it's a big string it's an html string shane app powerapps911.com so that's all that's required with the mailto function just that little bit but then what we can do is we can add parameters to the end so we do that by setting a question mark and then once we've set the question mark we can then use a bunch of optional things like cc so carbon copy right chewy at powerapps911.com comma right my instinct was use a semicolon here it's a comma and so i separated the two email addresses that's why both chewie and ferguson are getting copied and then you notice i'm like all right well i did a cc well i want to do a bcc so we did an amber sand so concatenate onto that and it's bcc shane at powerapps911 i apparently want to send myself the email twice who knows and then i did another ambersand and here i said all right subject equals and then mail from powerapps another amber sand body equals and then the body text and so with this you know by pressing this button we got all this stuff done but like you know what shane i don't want to do anything i don't want a cc or bcc right we can literally just pull those two pieces out like that maybe we don't want a subject maybe we just want the body so they're all optional right other than the actual two so if we hit play now and press the button what are we gonna get so we notice we've got to shane and then it looks like um nothing else what did i do wrong oh you know what i did wrong i put the amber stand when i need it oh i'm glad i messed up actually let's go fix that real quick go back over here it did not mean to have the amber stand right the first property doesn't need any and so let's try again launch there you go now that's an important thing to note about this right there's no harm in trying i'm not sending these people emails even though it's me i'm just popping open the outlook client not until i hit the literal send button here or control enter as i like to use um well it's in the email so this is an easy thing for you to iterate and test through also notice that this time when i include a body you lose your signature right if we click on the previous message when i didn't include a body here because i had that typo then i got my email signature there's nothing you can do about that you can't say i want to set a body and keep their signature so kind of keep that in mind also remember that this thing is just one big long string so let's just undo put all of our pieces back right because i want to keep this i did want to cut out real quick the body goes here you notice i did this this percent 0d percent 0a so this is the encoding that makes outlook include a space now what's really annoying about this i'm going to tell you the bad things as always is that that particular encoding does cause a line break in outlook on my desktop but on outlook on my phone it does not if i wanted to show on my phone so i made a phone app earlier today then i literally just typed in spaces and sent the spaces because it was using raw text so one of the things you're going to have to do and this is the fun of this is you're going to have to massage it depending on what your primary target is and you know maybe you end up writing a bunch of crazy logic to do it i don't want to go down that road i'm not going to go down that road but you know if you really want to get a body perfectly formatted you're probably going to need to know what device they're primarily going to use or you're going to have to write some really confusing logic here to be like oh if you're using this client click this button type of stuff so one just plant that seed i'm not going to solve that problem for you i'm just going to tell you might have it now the other thing you might be thinking is well shane that's great you hard coded everything but what if i wanted to make the mail the this portion dynamic remember this is a string so i could just use my normal powerapps skills right hey take that string and concatenate in here user dot email and then that way i would just automatically be on the two line right or you know maybe i want to have so i have a two box right here what is this this is combo box one so maybe what we're going to do is we're going to say hey instead of hard coding that maybe i want to do combo box one dot selected and then dot email or dot mail and so then now if we hit play or here let's make the body um let's use this rich text editor one right and so then i go down here to the body and be like hey body instead of all of that i want you to be equals and then i would close i would do an amberson i'd say rich text editor one dot html text i get rid of that close and so then now if i go in here and search for chewy there's chewy and then if i put something in here i'll enter some rich text here yeah yeah yeah yeah i don't know what it says but there you go and so then it dropped me in here now notice that the rich text editor is doing html output that's why you see the html tags here so i probably didn't want to use a rich text editor in this case i would have used a regular text input but you get the idea right that's what i want you guys to notice here is that you are in complete control because all it's about is what do you do to craft this string so if you want to include text from a variable a bunch of data out of a gallery i don't care make this string the way you want and you've got what you want now i will remind you if you want to download this app and have all this working code for all the fun stuff you see here remember you go to training.powerapps911.com and subscribe to the curated library you can watch and get all my videos right there's 100 or over 100 at this point not hundreds yet almost hundreds um but you can get the apps or you can get the videos you can download the videos you can download this app and all the other apps that are out there and so that way you can get a bunch of going much faster so as always you have any thoughts comments leave them below right do you like this quick format do you have other ideas i'm always looking for ideas for these quick five to ten minute videos i think they're a lot of fun because i can just do these things really fast i jump in i teach you something i get out i'm still gonna keep making all those long videos so don't get excited right we have a one short video a week one bit long video long video a week oh i'm so worked up i can't talk all right any thoughts leave me comments below and with that i'm going to say thanks and have a great day before you go be sure to click on the subscribe button over here so that way you'll be notified when new videos come out if you need any help or you want to work together whether your problem is big or small check us out at powerapps911 we do it all i rhymed or if you're looking for more formal training offerings we have those linked up here somewhere so check them out thanks and have a great day
Info
Channel: Shane Young
Views: 30,337
Rating: undefined out of 5
Keywords: Shane Young, powerapps911, PowerApps, Power Apps, powerapps mailto link, powerapps mailto button, powerapps mailto launch, power apps mailto, powerapps launch function, powerapps launch, powerapps open outlook
Id: OGcofeqPFlc
Channel Id: undefined
Length: 9min 12sec (552 seconds)
Published: Thu Oct 22 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.