u
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
<title>Get in touch with us@IIMTT</title>
|
||||
<meta name="description" content="Still have a question about Montessori education? Trying to choose the right course to study?contact with us for more details.">
|
||||
<link rel="canonical" href="https://iimtt.org/contact">
|
||||
<!-- ✅ Add Google reCAPTCHA script -->
|
||||
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
@@ -53,6 +51,9 @@ include("_navbar.php");
|
||||
<p style="font-size: 14px;color:white;">
|
||||
<span style="color: #f7a325; font-size: 16PX;font-weight: bold;">India:</span><br> DE 2B VIP Road, Kolkata 59, West Bengal<br>
|
||||
<img style="height: 20px;" src="/assets/img/phone.png" alt="phone">+91-334058-5535<br>
|
||||
<!--
|
||||
<img style="height: 15px;" src="/assets/img/message.jpeg" alt="message"> enquiry@atheneumglobal.education<br>
|
||||
-->
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -61,6 +62,9 @@ include("_navbar.php");
|
||||
<div class="container"><p style="color:white;font-size: 14px;">
|
||||
<span style="color: #00c1b1; font-size: 16PX;font-weight: bold;">Vietnam:</span><br> Cổ Nhuế 1, Từ Liêm, Hanoi, Vietnam<br>
|
||||
<img style="height: 20px;" src="/assets/img/phone.png" alt="phone"> +0359057904<br>
|
||||
<!--
|
||||
<img style="height: 15px;" src="/assets/img/message.jpeg" alt="message"> enquiry@atheneumglobal.co.uk<br>
|
||||
-->
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -69,6 +73,9 @@ include("_navbar.php");
|
||||
<p style="color: white; font-size: 14px;">
|
||||
<span style="color: #0189c8; font-size: 16PX;font-weight: bold;">Kenya:</span><br> Eldama Ravine Cl, Nairobi, Kenya<br>
|
||||
<img style="height: 20px;" src="/assets/img/phone.png" alt="phone"> +0737999928<br>
|
||||
<!--
|
||||
<img style="height: 15px;" src="/assets/img/message.jpeg" alt="message"> enquiry@atheneumglobal.co.uk<br>
|
||||
-->
|
||||
</p>
|
||||
</div></div>
|
||||
</div>
|
||||
@@ -81,21 +88,24 @@ include("_navbar.php");
|
||||
<!-- Form -->
|
||||
<form class="" role="form" method="post">
|
||||
<div class="form-group mb-5">
|
||||
<!-- Input -->
|
||||
<input type="text" aria-required="true" name="widget-contact-form-name" required
|
||||
class="form-control required name" id="name1" placeholder="Enter your Name">
|
||||
class="form-control required name" id="name1" placeholder="Enter your Name">
|
||||
</div>
|
||||
<div class="form-group mb-5">
|
||||
<!-- Input -->
|
||||
<input class="form-control" id="phn" type="number" name="telephone"
|
||||
placeholder="Enter your Contact number" required>
|
||||
<p id="phnError" style="color: red; display: none;">Enter a valid phone number</p>
|
||||
<p id="phnError" style="color: red; display: none;">Enter a valid phone number</p>
|
||||
</div>
|
||||
<div class="form-group mb-5">
|
||||
<!-- Input -->
|
||||
<input type="email" id="email" aria-required="true" name="widget-contact-form-email"
|
||||
required class="form-control required email" placeholder="Enter your Email">
|
||||
<p id="emailError" style="color: red; display: none;">Enter a valid email address</p>
|
||||
<p id="emailError" style="color: red; display: none;">Enter a valid email address</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" id="addr" name="address"
|
||||
<input type="text" class="form-control" id="addr" name="address"
|
||||
placeholder="Enter your Full Address" required>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -111,17 +121,33 @@ include("_navbar.php");
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-7 mb-md-9">
|
||||
|
||||
<!-- Input -->
|
||||
<textarea type="text" name="widget-contact-form-message" required rows="3"
|
||||
class="form-control required" id="message" placeholder="Enter your Message"></textarea>
|
||||
|
||||
</div> <!-- / .row -->
|
||||
<!--
|
||||
<div class="form-group mb-5 d-none">
|
||||
|
||||
<!-- Label --
|
||||
<label for="contactMessage">
|
||||
What can we help you with?
|
||||
</label>
|
||||
|
||||
<!-- Input --
|
||||
<textarea class="form-control" id="message" rows="5"
|
||||
placeholder="Tell us what we can help you with!"></textarea>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ✅ Google reCAPTCHA Widget -->
|
||||
<div class="form-group text-center">
|
||||
<div class="g-recaptcha" data-sitekey="6LfLjvgrAAAAAIlFINpRhfP5HgnJbJ8lPQbVky8Z"></div>
|
||||
<p id="captchaError" style="color: red; display: none;">Please verify you are not a robot.</p>
|
||||
</div>
|
||||
|
||||
-->
|
||||
<div class="form-group mb-0">
|
||||
|
||||
<!-- Submit --
|
||||
<a href="#" style="background-color: #f7a325;margin:10px;" class="btn btn-sm btn-block lift">
|
||||
Send message
|
||||
</a>-->
|
||||
|
||||
<button style="background-color: #f7a325;margin:10px;" class="btn btn-sm btn-block lift" type="button" onclick="submitForm()"> Send message</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -129,91 +155,85 @@ include("_navbar.php");
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script type="text/javascript">
|
||||
var name, addr, phn, email, message, subject;
|
||||
<script type="text/javascript">
|
||||
var option = null;
|
||||
var name = null;
|
||||
var addr = null;
|
||||
var phn = null;
|
||||
var subject = null;
|
||||
var email = null;
|
||||
var message = null;
|
||||
var warning = document.getElementById('warning');
|
||||
var success = document.getElementById('success');
|
||||
var emailError = document.getElementById('emailError');
|
||||
var phnError = document.getElementById('phnError');
|
||||
var req = document.getElementById("req");
|
||||
var captchaError = document.getElementById('captchaError');
|
||||
|
||||
function setOptions(s) {
|
||||
// console.log(s[s.selectedIndex].value); // get value
|
||||
option = s[s.selectedIndex].value;
|
||||
// console.log(s[s.selectedIndex].id); // get id
|
||||
}
|
||||
function submitForm() {
|
||||
name = document.getElementById("name1").value;
|
||||
phn = document.getElementById("phn").value;
|
||||
addr = document.getElementById("addr").value;
|
||||
email = document.getElementById("email").value;
|
||||
message = document.getElementById("message").value;
|
||||
subject = req.options[req.selectedIndex].value;
|
||||
|
||||
success.style.display = "none";
|
||||
captchaError.style.display = "none";
|
||||
|
||||
var reg = /^([A-Za-z0-9_\-\.])+@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
||||
var mobile = /^\d{10}$/;
|
||||
|
||||
// ✅ Check for empty fields
|
||||
if (!name || !phn || !addr || !email || !message || !subject) {
|
||||
subject = req.options[req.selectedIndex].value;
|
||||
console.log(name+phn+addr+email+message+subject);
|
||||
if (name == '' || addr == '' || phn == '' || email == '' || message == '' || subject == '') {
|
||||
warning.style.display = "block";
|
||||
return;
|
||||
}
|
||||
|
||||
// ✅ Validate email & phone
|
||||
if (!reg.test(email)) {
|
||||
emailError.style.display = "block";
|
||||
return;
|
||||
} else {
|
||||
emailError.style.display = "none";
|
||||
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
||||
var mobile = /^\d{10}$/;
|
||||
|
||||
if (reg.test(email) == false) {
|
||||
emailError.style.display = "block";
|
||||
}else if (mobile.test(phn) == false) {
|
||||
phnError.style.display = "block";
|
||||
} else {
|
||||
emailError.style.display = "none";
|
||||
warning.style.display = "none";
|
||||
let formData = new FormData();
|
||||
formData.append('formName', 'IIMTT-Contact-Form');
|
||||
formData.append('business_type', 'iimtt');
|
||||
formData.append('Name', name);
|
||||
formData.append('Email', email);
|
||||
formData.append('Phone', phn);
|
||||
formData.append('Field', subject);
|
||||
formData.append('Address', addr);
|
||||
formData.append('MessageDetails', message + " Field:" + subject);
|
||||
fetch('https://api.teenybeans.in/API/contactFormProcessor/v1/', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
// console.log(json);
|
||||
// sendMail("enquiry@atheneumglobal.education");
|
||||
sendMail("teenybeans.info@gmail.com");
|
||||
sendMail("enquiry@beanstalkedu.com");
|
||||
// sendMail("chatterjeegouravking@gmail.com");
|
||||
sendWelcomeMail(email);
|
||||
success.style.display = "block";
|
||||
document.getElementById("name1").value = "";
|
||||
document.getElementById("phn").value = "";
|
||||
document.getElementById("addr").value = "";
|
||||
document.getElementById("email").value = "";
|
||||
document.getElementById("message").value = "";
|
||||
|
||||
// window.location.href = "contact-back";
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!mobile.test(phn)) {
|
||||
phnError.style.display = "block";
|
||||
return;
|
||||
} else {
|
||||
phnError.style.display = "none";
|
||||
}
|
||||
|
||||
// ✅ Verify reCAPTCHA
|
||||
var captchaResponse = grecaptcha.getResponse();
|
||||
if (!captchaResponse.length) {
|
||||
captchaError.style.display = "block";
|
||||
return;
|
||||
}
|
||||
|
||||
warning.style.display = "none";
|
||||
|
||||
// ✅ Send form data
|
||||
let formData = new FormData();
|
||||
formData.append('formName', 'IIMTT-Contact-Form');
|
||||
formData.append('business_type', 'iimtt');
|
||||
formData.append('Name', name);
|
||||
formData.append('Email', email);
|
||||
formData.append('Phone', phn);
|
||||
formData.append('Field', subject);
|
||||
formData.append('Address', addr);
|
||||
formData.append('MessageDetails', message + " Field:" + subject);
|
||||
|
||||
fetch('https://api.teenybeans.in/API/contactFormProcessor/v1/', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
sendMail("teenybeans.info@gmail.com");
|
||||
sendMail("enquiry@beanstalkedu.com");
|
||||
sendWelcomeMail(email);
|
||||
success.style.display = "block";
|
||||
document.getElementById("name1").value = "";
|
||||
document.getElementById("phn").value = "";
|
||||
document.getElementById("addr").value = "";
|
||||
document.getElementById("email").value = "";
|
||||
document.getElementById("message").value = "";
|
||||
grecaptcha.reset(); // reset captcha after submission
|
||||
});
|
||||
// if(name)
|
||||
}
|
||||
|
||||
function sendMail(sendEmail) {
|
||||
// ---------Mail sent-----------------
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append("sendMail", "true");
|
||||
formData.append("reciever", sendEmail);
|
||||
@@ -239,10 +259,19 @@ include("_navbar.php");
|
||||
fetch("https://mailapi.teenybeans.in/009/", {
|
||||
method: "POST",
|
||||
body: formData
|
||||
});
|
||||
})
|
||||
.then(function (response) {
|
||||
response.json().then(function (data) {
|
||||
// console.log(data);
|
||||
});
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.log("Fetch Error :-S", err);
|
||||
});
|
||||
}
|
||||
|
||||
function sendWelcomeMail(sendEmail) {
|
||||
// ---------Mail sent-----------------
|
||||
console.log(sendEmail);
|
||||
let formData = new FormData();
|
||||
formData.append("sendMail", "true");
|
||||
formData.append("reciever", sendEmail);
|
||||
@@ -251,6 +280,10 @@ include("_navbar.php");
|
||||
formData.append("subject", "Thank you for contacting IIMTT.");
|
||||
formData.append(
|
||||
"message",
|
||||
// "<html><body><p>Welcome " +
|
||||
// name +
|
||||
// " to IIMTT.<br>Thank you for contacting us. <br> We will get back to you shortly. In the meanwhile please do check out our website for more information. <a href='https://iimtt.org'>click here</a><br>Thank you<br>-Team IIMTT. </p></body></html>"
|
||||
|
||||
'<html><body style="background-color:#f5f8f5;padding:16px;"><div style="text-align:center"><a href="#"><img style="width:150px;" src="http://iimtt.org/assets/img/iimtt-footer-logo.png"></a></div>'+
|
||||
'<div><p>Hi '+name+'</p><p>Thank you for reaching International Institute of Montessori Teacher Training.</p>'+
|
||||
'<p>IIMTT was established to help meet the growing demand for Montessori teachers in India and abroad.Our course equips participants to educate children in the Montessori Method, at the pre-primary level anywhere in the world.</p>'+
|
||||
@@ -262,7 +295,15 @@ include("_navbar.php");
|
||||
fetch("https://mailapi.teenybeans.in/009/", {
|
||||
method: "POST",
|
||||
body: formData
|
||||
});
|
||||
})
|
||||
.then(function (response) {
|
||||
response.json().then(function (data) {
|
||||
console.log(data);
|
||||
});
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.log("Fetch Error :-S", err);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
</script>
|
||||
213
contact.php
213
contact.php
@@ -2,6 +2,8 @@
|
||||
<title>Get in touch with us@IIMTT</title>
|
||||
<meta name="description" content="Still have a question about Montessori education? Trying to choose the right course to study?contact with us for more details.">
|
||||
<link rel="canonical" href="https://iimtt.org/contact">
|
||||
<!-- ✅ Add Google reCAPTCHA script -->
|
||||
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
@@ -51,9 +53,6 @@ include("_navbar.php");
|
||||
<p style="font-size: 14px;color:white;">
|
||||
<span style="color: #f7a325; font-size: 16PX;font-weight: bold;">India:</span><br> DE 2B VIP Road, Kolkata 59, West Bengal<br>
|
||||
<img style="height: 20px;" src="/assets/img/phone.png" alt="phone">+91-334058-5535<br>
|
||||
<!--
|
||||
<img style="height: 15px;" src="/assets/img/message.jpeg" alt="message"> enquiry@atheneumglobal.education<br>
|
||||
-->
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -62,9 +61,6 @@ include("_navbar.php");
|
||||
<div class="container"><p style="color:white;font-size: 14px;">
|
||||
<span style="color: #00c1b1; font-size: 16PX;font-weight: bold;">Vietnam:</span><br> Cổ Nhuế 1, Từ Liêm, Hanoi, Vietnam<br>
|
||||
<img style="height: 20px;" src="/assets/img/phone.png" alt="phone"> +0359057904<br>
|
||||
<!--
|
||||
<img style="height: 15px;" src="/assets/img/message.jpeg" alt="message"> enquiry@atheneumglobal.co.uk<br>
|
||||
-->
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -73,9 +69,6 @@ include("_navbar.php");
|
||||
<p style="color: white; font-size: 14px;">
|
||||
<span style="color: #0189c8; font-size: 16PX;font-weight: bold;">Kenya:</span><br> Eldama Ravine Cl, Nairobi, Kenya<br>
|
||||
<img style="height: 20px;" src="/assets/img/phone.png" alt="phone"> +0737999928<br>
|
||||
<!--
|
||||
<img style="height: 15px;" src="/assets/img/message.jpeg" alt="message"> enquiry@atheneumglobal.co.uk<br>
|
||||
-->
|
||||
</p>
|
||||
</div></div>
|
||||
</div>
|
||||
@@ -88,24 +81,21 @@ include("_navbar.php");
|
||||
<!-- Form -->
|
||||
<form class="" role="form" method="post">
|
||||
<div class="form-group mb-5">
|
||||
<!-- Input -->
|
||||
<input type="text" aria-required="true" name="widget-contact-form-name" required
|
||||
class="form-control required name" id="name1" placeholder="Enter your Name">
|
||||
class="form-control required name" id="name1" placeholder="Enter your Name">
|
||||
</div>
|
||||
<div class="form-group mb-5">
|
||||
<!-- Input -->
|
||||
<input class="form-control" id="phn" type="number" name="telephone"
|
||||
placeholder="Enter your Contact number" required>
|
||||
<p id="phnError" style="color: red; display: none;">Enter a valid phone number</p>
|
||||
<p id="phnError" style="color: red; display: none;">Enter a valid phone number</p>
|
||||
</div>
|
||||
<div class="form-group mb-5">
|
||||
<!-- Input -->
|
||||
<input type="email" id="email" aria-required="true" name="widget-contact-form-email"
|
||||
required class="form-control required email" placeholder="Enter your Email">
|
||||
<p id="emailError" style="color: red; display: none;">Enter a valid email address</p>
|
||||
<p id="emailError" style="color: red; display: none;">Enter a valid email address</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" id="addr" name="address"
|
||||
<input type="text" class="form-control" id="addr" name="address"
|
||||
placeholder="Enter your Full Address" required>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -121,33 +111,17 @@ include("_navbar.php");
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-7 mb-md-9">
|
||||
|
||||
<!-- Input -->
|
||||
<textarea type="text" name="widget-contact-form-message" required rows="3"
|
||||
class="form-control required" id="message" placeholder="Enter your Message"></textarea>
|
||||
|
||||
</div> <!-- / .row -->
|
||||
<!--
|
||||
<div class="form-group mb-5 d-none">
|
||||
|
||||
<!-- Label --
|
||||
<label for="contactMessage">
|
||||
What can we help you with?
|
||||
</label>
|
||||
|
||||
<!-- Input --
|
||||
<textarea class="form-control" id="message" rows="5"
|
||||
placeholder="Tell us what we can help you with!"></textarea>
|
||||
|
||||
</div>
|
||||
-->
|
||||
<div class="form-group mb-0">
|
||||
|
||||
<!-- Submit --
|
||||
<a href="#" style="background-color: #f7a325;margin:10px;" class="btn btn-sm btn-block lift">
|
||||
Send message
|
||||
</a>-->
|
||||
|
||||
<!-- ✅ Google reCAPTCHA Widget -->
|
||||
<div class="form-group text-center">
|
||||
<div class="g-recaptcha" data-sitekey="6LfLjvgrAAAAAIlFINpRhfP5HgnJbJ8lPQbVky8Z"></div>
|
||||
<p id="captchaError" style="color: red; display: none;">Please verify you are not a robot.</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-0">
|
||||
<button style="background-color: #f7a325;margin:10px;" class="btn btn-sm btn-block lift" type="button" onclick="submitForm()"> Send message</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -155,85 +129,91 @@ include("_navbar.php");
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script type="text/javascript">
|
||||
var option = null;
|
||||
var name = null;
|
||||
var addr = null;
|
||||
var phn = null;
|
||||
var subject = null;
|
||||
var email = null;
|
||||
var message = null;
|
||||
|
||||
<script type="text/javascript">
|
||||
var name, addr, phn, email, message, subject;
|
||||
var warning = document.getElementById('warning');
|
||||
var success = document.getElementById('success');
|
||||
var emailError = document.getElementById('emailError');
|
||||
var phnError = document.getElementById('phnError');
|
||||
var req = document.getElementById("req");
|
||||
function setOptions(s) {
|
||||
// console.log(s[s.selectedIndex].value); // get value
|
||||
option = s[s.selectedIndex].value;
|
||||
// console.log(s[s.selectedIndex].id); // get id
|
||||
}
|
||||
var captchaError = document.getElementById('captchaError');
|
||||
|
||||
function submitForm() {
|
||||
name = document.getElementById("name1").value;
|
||||
phn = document.getElementById("phn").value;
|
||||
addr = document.getElementById("addr").value;
|
||||
email = document.getElementById("email").value;
|
||||
message = document.getElementById("message").value;
|
||||
success.style.display = "none";
|
||||
subject = req.options[req.selectedIndex].value;
|
||||
console.log(name+phn+addr+email+message+subject);
|
||||
if (name == '' || addr == '' || phn == '' || email == '' || message == '' || subject == '') {
|
||||
|
||||
success.style.display = "none";
|
||||
captchaError.style.display = "none";
|
||||
|
||||
var reg = /^([A-Za-z0-9_\-\.])+@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
||||
var mobile = /^\d{10}$/;
|
||||
|
||||
// ✅ Check for empty fields
|
||||
if (!name || !phn || !addr || !email || !message || !subject) {
|
||||
warning.style.display = "block";
|
||||
} else {
|
||||
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
||||
var mobile = /^\d{10}$/;
|
||||
|
||||
if (reg.test(email) == false) {
|
||||
emailError.style.display = "block";
|
||||
}else if (mobile.test(phn) == false) {
|
||||
phnError.style.display = "block";
|
||||
} else {
|
||||
emailError.style.display = "none";
|
||||
warning.style.display = "none";
|
||||
let formData = new FormData();
|
||||
formData.append('formName', 'IIMTT-Contact-Form');
|
||||
formData.append('business_type', 'iimtt');
|
||||
formData.append('Name', name);
|
||||
formData.append('Email', email);
|
||||
formData.append('Phone', phn);
|
||||
formData.append('Field', subject);
|
||||
formData.append('Address', addr);
|
||||
formData.append('MessageDetails', message + " Field:" + subject);
|
||||
fetch('https://api.teenybeans.in/API/contactFormProcessor/v1/', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
// console.log(json);
|
||||
// sendMail("enquiry@atheneumglobal.education");
|
||||
sendMail("teenybeans.info@gmail.com");
|
||||
sendMail("enquiry@beanstalkedu.com");
|
||||
// sendMail("chatterjeegouravking@gmail.com");
|
||||
sendWelcomeMail(email);
|
||||
success.style.display = "block";
|
||||
document.getElementById("name1").value = "";
|
||||
document.getElementById("phn").value = "";
|
||||
document.getElementById("addr").value = "";
|
||||
document.getElementById("email").value = "";
|
||||
document.getElementById("message").value = "";
|
||||
|
||||
// window.location.href = "contact-back";
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
// if(name)
|
||||
|
||||
// ✅ Validate email & phone
|
||||
if (!reg.test(email)) {
|
||||
emailError.style.display = "block";
|
||||
return;
|
||||
} else {
|
||||
emailError.style.display = "none";
|
||||
}
|
||||
|
||||
if (!mobile.test(phn)) {
|
||||
phnError.style.display = "block";
|
||||
return;
|
||||
} else {
|
||||
phnError.style.display = "none";
|
||||
}
|
||||
|
||||
// ✅ Verify reCAPTCHA
|
||||
var captchaResponse = grecaptcha.getResponse();
|
||||
if (!captchaResponse.length) {
|
||||
captchaError.style.display = "block";
|
||||
return;
|
||||
}
|
||||
|
||||
warning.style.display = "none";
|
||||
|
||||
// ✅ Send form data
|
||||
let formData = new FormData();
|
||||
formData.append('formName', 'IIMTT-Contact-Form');
|
||||
formData.append('business_type', 'iimtt');
|
||||
formData.append('Name', name);
|
||||
formData.append('Email', email);
|
||||
formData.append('Phone', phn);
|
||||
formData.append('Field', subject);
|
||||
formData.append('Address', addr);
|
||||
formData.append('MessageDetails', message + " Field:" + subject);
|
||||
|
||||
fetch('https://api.teenybeans.in/API/contactFormProcessor/v1/', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
sendMail("teenybeans.info@gmail.com");
|
||||
sendMail("enquiry@beanstalkedu.com");
|
||||
sendWelcomeMail(email);
|
||||
success.style.display = "block";
|
||||
document.getElementById("name1").value = "";
|
||||
document.getElementById("phn").value = "";
|
||||
document.getElementById("addr").value = "";
|
||||
document.getElementById("email").value = "";
|
||||
document.getElementById("message").value = "";
|
||||
grecaptcha.reset(); // reset captcha after submission
|
||||
});
|
||||
}
|
||||
|
||||
function sendMail(sendEmail) {
|
||||
// ---------Mail sent-----------------
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append("sendMail", "true");
|
||||
formData.append("reciever", sendEmail);
|
||||
@@ -259,19 +239,10 @@ include("_navbar.php");
|
||||
fetch("https://mailapi.teenybeans.in/009/", {
|
||||
method: "POST",
|
||||
body: formData
|
||||
})
|
||||
.then(function (response) {
|
||||
response.json().then(function (data) {
|
||||
// console.log(data);
|
||||
});
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.log("Fetch Error :-S", err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function sendWelcomeMail(sendEmail) {
|
||||
// ---------Mail sent-----------------
|
||||
console.log(sendEmail);
|
||||
let formData = new FormData();
|
||||
formData.append("sendMail", "true");
|
||||
formData.append("reciever", sendEmail);
|
||||
@@ -280,10 +251,6 @@ include("_navbar.php");
|
||||
formData.append("subject", "Thank you for contacting IIMTT.");
|
||||
formData.append(
|
||||
"message",
|
||||
// "<html><body><p>Welcome " +
|
||||
// name +
|
||||
// " to IIMTT.<br>Thank you for contacting us. <br> We will get back to you shortly. In the meanwhile please do check out our website for more information. <a href='https://iimtt.org'>click here</a><br>Thank you<br>-Team IIMTT. </p></body></html>"
|
||||
|
||||
'<html><body style="background-color:#f5f8f5;padding:16px;"><div style="text-align:center"><a href="#"><img style="width:150px;" src="http://iimtt.org/assets/img/iimtt-footer-logo.png"></a></div>'+
|
||||
'<div><p>Hi '+name+'</p><p>Thank you for reaching International Institute of Montessori Teacher Training.</p>'+
|
||||
'<p>IIMTT was established to help meet the growing demand for Montessori teachers in India and abroad.Our course equips participants to educate children in the Montessori Method, at the pre-primary level anywhere in the world.</p>'+
|
||||
@@ -295,15 +262,7 @@ include("_navbar.php");
|
||||
fetch("https://mailapi.teenybeans.in/009/", {
|
||||
method: "POST",
|
||||
body: formData
|
||||
})
|
||||
.then(function (response) {
|
||||
response.json().then(function (data) {
|
||||
console.log(data);
|
||||
});
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.log("Fetch Error :-S", err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user