-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontactPage.js
30 lines (25 loc) · 954 Bytes
/
contactPage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const form = document.querySelector("form")
const logo = document.querySelector("#logo")
// console.log(logo)
logo.addEventListener("click", () => {
window.location.assign("index.html")
})
function sendMessage(name, email, message) {
Email.send({
SecureToken: "1d792475-f528-42be-a789-8caeffcbba9e",
To: "mmaarafat80@gmail.com",
From: document.getElementById("email").value,
Subject: "New message",
Body: `You got a message from ${name} <br/> from ${email} <br/>${message} `
}).then(
message => alert("Your message send successfully")
);
}
form.addEventListener("submit", (e) => {
e.preventDefault()
const name = document.getElementById("name").value
const email = document.getElementById("email").value
const message = document.getElementById("textarea").value
console.log(name, email, message)
sendMessage(name, email, message)
})