Setup email massage when typing in the tracking number

If you go to my store : Pilassia.com you will see there’s an TRACK ORDER page, now, I’ve copied the code manually by OnHow, youtube link : https://www.youtube.com/watch?v=si9LVk2DSmc . and then i saw the 200+ lines of code for the email. I could sit down and copy it word by word but I don’t want to, could someone show me a lazier way to setup the link between the pressing of the button “TRACK” to an email sent with the information about the delivery? .

In short: I want to connect the track button to an automatic email to the customer with the right information