function ready(){ $('#comp-jrxte6sp9submit').click(gatherEmailData) } $(ready) var modal = "

This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.

" function gatherEmailData() { var name = $('#name').val() var phone = $('#phone').val() var email = $('#email').val() var address = $('#address').val() var subject = $('#subject').val() var body = $('#body').val() var requestBody = {} if (email.includes("@") == false) { alert("Invalid Email", "Please enter a valid email address") return } if (phone.length < 10) { alert("Invalid Phone Number", "Please enter a valid phone number") return } if (body.length < 10) { alert("Invalid Message", "This message is really short. Please provide more information so that we can better serve you") return } requestBody['email'] = email requestBody['subject'] = subject body = "Name:"+name+'\n'+"Phone:"+phone+"\n"+"Address:"+address+"\n"+"Email:"+email+"\n\n\n"+body sendEmail(email,subject,body) } function sendEmail(email_address, subject, body){ var requestBody = {} requestBody['from'] = email_address requestBody['subject'] = subject requestBody['body'] = body var popUp = alert("Sending email","This box will close when your message is sent") var ajaxOptions = { url:'https://mfuu7xn10e.execute-api.us-east-1.amazonaws.com/default/send-vast-contact-mail/mail', method:'post', headers: {'X-Api-Key': 'YiEW3F15tF5iTVngZWgRA2OuIfdlvuYd66EmdZ1t'}, data: JSON.stringify(requestBody), complete:function(){popUp.dialog('close')}, success:function(aData){ alert("Email Sent!", "We've received your email and will get back to you shortly. Have a wonderful day!") }, error: function(jqXHR,textStatus, errorThrown){printError(jqXHR,textStatus, errorThrown,"Email could not be sent. Please press send again")} } $.ajax(ajaxOptions); } function printError(jqXHR,textStatus, errorThrown, errorMessage) { console.log(textStatus) console.log(errorThrown) alert("Error!!",errorMessage) } function alert(title,message){ var div = $('
') div.attr('title', title); div.dialog().html(message) return div }
top of page

Contact Vast

Office Hours:

Monday & Friday      8:00 AM to 5:00 PM

Tuesday, Wednesday, & Thursday 8:00 AM to 8:00 PM

Saturday by appointment only

713-516-3527

Thanks for submitting!

bottom of page