Skip to content

Commit 468570c

Browse files
committed
Fix EmailJS validation logic and add credentials configuration
1 parent 437adc8 commit 468570c

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

script.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,9 +1105,9 @@ function initPortfolioFilter() {
11051105
// 6. Replace the values below with your credentials
11061106
//
11071107
const EMAILJS_CONFIG = {
1108-
SERVICE_ID: 'YOUR_SERVICE_ID', // Your EmailJS Service ID
1109-
TEMPLATE_ID: 'YOUR_TEMPLATE_ID', // Your EmailJS Template ID
1110-
PUBLIC_KEY: 'YOUR_PUBLIC_KEY' // Your EmailJS Public Key
1108+
SERVICE_ID: 'service_ehrdd8k', // Your EmailJS Service ID
1109+
TEMPLATE_ID: 'template_l6mvkpc', // Your EmailJS Template ID
1110+
PUBLIC_KEY: 'R2Xn7mUUj4SgdJQqw' // Your EmailJS Public Key
11111111
};
11121112

11131113
// === Contact Form Handler ===
@@ -1133,9 +1133,9 @@ function initContactForm() {
11331133
e.preventDefault();
11341134

11351135
// Check if EmailJS is configured
1136-
if (EMAILJS_CONFIG.SERVICE_ID === 'service_903s2j8' ||
1137-
EMAILJS_CONFIG.TEMPLATE_ID === 'template_l6mvkpc' ||
1138-
EMAILJS_CONFIG.PUBLIC_KEY === 'R2Xn7mUUj4SgdJQqw') {
1136+
if (EMAILJS_CONFIG.SERVICE_ID === 'YOUR_SERVICE_ID' ||
1137+
EMAILJS_CONFIG.TEMPLATE_ID === 'YOUR_TEMPLATE_ID' ||
1138+
EMAILJS_CONFIG.PUBLIC_KEY === 'YOUR_PUBLIC_KEY') {
11391139
alert('EmailJS is not configured. Please add your Service ID, Template ID, and Public Key in script.js');
11401140
return;
11411141
}
@@ -1145,7 +1145,7 @@ function initContactForm() {
11451145
alert('EmailJS SDK is not loaded. Please check your internet connection.');
11461146
return;
11471147
}
1148-
1148+
11491149
// Get form data
11501150
const formData = new FormData(form);
11511151
const templateParams = {
@@ -1173,7 +1173,7 @@ function initContactForm() {
11731173
if (response.status === 200) {
11741174
// Show success message
11751175
showFormMessage('success', 'Thank you for your message! We will get back to you soon.');
1176-
form.reset();
1176+
form.reset();
11771177
} else {
11781178
throw new Error('Failed to send message');
11791179
}

0 commit comments

Comments
 (0)