I would suggest that you check Wix examples for using it with SendGrid and search this forum for previous posts about using SendGrid as your code has errors.
For starters, this bit at the top here is all happening before you have actually imported your backend email file and the page itself has loaded and is ready to go.
let address = $w(" #addressInput1 “).value; $w(” #addressInput1 ") ; });