 Okay, this is a follow-up to a previous video where I showed you how to quickly create a button in HTML on a web page for generating an Email with invoice or whatever. We're gonna quickly look at doing that good Oh because I mentioned in that video you could do it with any programming language So we're gonna look at in here. So I'm going ahead and new project I'm just gonna call it invoice because we're generating an email It's gonna send invoices theoretically create that create that and edit it. I'm gonna do this real sloppily I'm gonna say 2d. Although you could create something 3d that you click on But we'll rename this invoice Sender sure But we're going to now add a child and I'm just going to make it a button And I'm just gonna go a regular button here. I'm going to take that button I'm just gonna throw it in the center of screen here. Obviously you want to spend more time Making it look nice and centering it probably with code, but we're gonna say Send invoice, right? So we've created this button. We're gonna do this. We're gonna click over here on nodes We're gonna sell first add a script to our main mother object here, and we're going to say Attach a script. Yeah, we'll call it that Again, just going through this real quick. We're gonna say when this is pressed We are going to we'll use a function called send Invoice or email or whatever you want to call it doesn't really matter and we only really need one line of code in here We are going to say OS Shell open and then here we're going to say mail to and who we want to mail to customer at site.com And then we'll say so that will allow us to open up an email to a Certain person, but we also want to have a subject, right? So we're going to say question mark Subject equals Your invoice they get this to generate probably an invoice number that you can have put in there and they're going to say and Body now we could just put the body right here, but body might get a little big So what I'm going to do is I'm going to create a variable It's going to say var body up here. Okay, and then down here and then I'll just say Here is your invoice period Okay, and we're going to say body Now one thing different doing in here is it didn't like the HTML so in the HTML interface I was able to pass my Thunderbird HTML for some reason while I was doing that it was showing the HTML not generating the HTML So our format is going to be a little bit different here, but real quick I'm just going to give a link to a theoretical invoice so I'm going to say HTTPS my company com forward slash invoices ID and then you would have like Some random ID for that link so that they can get to it but nobody else can because they're not going to guess this big long string and If I typed everything properly we should be able to well save this first and we'll just call it invoice sender Sure, and I'll hit f5 and say yes I want this to be my default scene and we have this button and right now with with Godot you can Render this out. You can put it in a web page. You can make an APK for an Android phone You can make an executable for Windows or Linux and Ios and everything so you just create a program that should be cross-platform now when you're using shell open You're getting something that might not be compatible, but theoretically all those operating systems I haven't tested it should be able to open up a mail to link But again, I haven't tested it, but your web browser can do it So I would think your other applications could too, but I'm gonna click send it's gonna open up Thunderbird and here it is It has here's your invoice with that link And then I added a signature into my Thunderbird so that will always be at the bottom there Again, not as nice as looking as before we had some formatting and stuff because we use HTML I'm sure that's possible, but real quick. Let's just make this put this on a second line here So what we're gonna do is instead of using HTML we're gonna use URL encoding. So we're gonna do here is we're going to say percent zero a and that's a well should generate a new line. We're gonna hit f5 Send and there you go now Most web client or email clients will create that as a link once they receive it So they should be able to just click on that and go to the invoice again. This is very basic just generating an Email so directly this could be for anything I were using invoices as an example because that was a real-world situation that I recently encountered but you have your program it generates an invoice and Then you're gonna give someone access to that invoice And send them an email but not saying email using your application Which is just a bad idea, which is the problem that I recently got into with some people You want to use whatever the default email client is and that's what this does here Basically OS saying use your operating system use your shell and open up whatever default program. It is for mail So whatever you have on your operating system set up your default email client in my case It's Thunderbird here just as an example, but you can set this up for outlook or Gmail and you don't set up your application You say hey operating system What do you use to send emails? This is what I want to send and open it up and they can make modifications and then send it and that's it It's that simple literally One line of code. I broke it up onto two just to make it a little more me readable You don't want your lines to be too long, but that is it again We didn't get as fancy as the formatting as we did in the previous example I was hoping I'd just be able to use that HTML, but for example if I did h1 around this to make this a Header, which is what we did in the previous example You'll see when I do that in this example It actually puts the h1 there rather than formatting it like that again using Thunderbird So it's just Passing it somewhat different than the web browser was and I'm sure there's a way to get that to work Appropriately with your local applications rather than a web application Basic concept is there and the fact that some commercial products don't have this functionality when it's literally one to two lines of code Is a little ridiculous, but thanks for watching and as always I hope that you have a great day visit films by Chris comm That's Chris with a K playing a tutorial videos there again. Have a great day