-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1.html
69 lines (64 loc) · 3 KB
/
1.html
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form id="appointment-form">
<div class="formbold-mb-5">
<label for="name" class="formbold-form-label">Full Name</label>
<input type="text" name="name" id="name" placeholder="Full Name" class="formbold-form-input" />
</div>
<div class="formbold-mb-5">
<label for="phone" class="formbold-form-label">Phone Number</label>
<input type="text" name="phone" id="phone" placeholder="Enter your phone number" class="formbold-form-input" />
</div>
<div class="formbold-mb-5">
<label for="email" class="formbold-form-label">Email Address</label>
<input type="email" name="email" id="email" placeholder="Enter your email" class="formbold-form-input" />
</div>
<div class="formbold-mb-5">
<label for="message" class="formbold-form-label">Message</label>
<input type="message" name="message" id="message" placeholder="Enter your message" class="formbold-form-input" />
</div>
<!-- Add appointment date and time input fields here -->
<!-- Example: <input type="datetime-local" name="appointmentDateTime" id="appointmentDateTime" /> -->
<button type="button" onclick="sendAppointment()">Book Appointment</button>
</form>
<script src="https://cdn.emailjs.com/dist/email.min.js"></script>
<script>
// Initialize EmailJS with your user ID
emailjs.init('lEUcQj8FrMJspVoh7');
// Function to send the appointment details
function sendAppointment() {
const form = document.getElementById('appointment-form');
const name = form.elements.name.value;
const email = form.elements.email.value;
const phone = form.elements.phone.value;
const message = form.elements.message.value;
// Get the appointment date and time (if you added that field)
// Set up the email template
const templateParams = {
to_email: '[email protected]', // Replace with your recipient's email address
from_name: name,
from_email: email,
phone: phone,
message: message,
// Add appointment date and time to templateParams if needed
};
// Send the email
emailjs.send('service_c4z771e', 'template_w2jm7lo', templateParams)
.then(function (response) {
console.log('Email sent successfully:', response);
// Show a confirmation message to the user
alert('Mail Sent, Waiting for confirmation');
})
.catch(function (error) {
console.error('Error sending email:', error);
});
}
</script>
</body>
</html>