Skip to content

Commit 665e6b8

Browse files
committed
Remove public contact email placeholder
1 parent e6144f8 commit 665e6b8

4 files changed

Lines changed: 35 additions & 5 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ <h2 class="text-3xl font-bold mb-12 text-center">Contact Us</h2>
167167
class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-6 rounded-lg transition duration-300">Send
168168
Message</button>
169169
<p id="contactFormStatus" class="contact-form-status mt-4 text-sm text-slate-300" aria-live="polite">
170-
Submitting opens your email app with a pre-filled message to compliance.enlitech@gmail.com.
170+
Contact email will be enabled after the inbox is configured.
171171
</p>
172172
</form>
173173
</div>

js/contact-mailto.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
function buildContactMailtoUrl({ to, name, email, subject, message }) {
77
const recipient = sanitizeField(to);
8+
if (!recipient) {
9+
throw new Error('Recipient email is not configured.');
10+
}
11+
812
const emailSubject = sanitizeField(subject);
913
const body = [
1014
`Name: ${sanitizeField(name)}`,

js/script.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ document.addEventListener('DOMContentLoaded', () => {
66
setupCopyrightYear();
77
});
88

9+
const CONTACT_EMAIL = '';
10+
911
function setupCopyrightYear() {
1012
const copyright = document.getElementById('copyright');
1113
if (copyright) {
@@ -135,6 +137,17 @@ function setupContactForm() {
135137
const subjectInput = form.querySelector('#contactSubject');
136138
const messageInput = form.querySelector('#contactMessage');
137139
const statusElement = form.querySelector('#contactFormStatus');
140+
const submitButton = form.querySelector('button[type="submit"]');
141+
142+
if (!CONTACT_EMAIL) {
143+
if (submitButton) {
144+
submitButton.disabled = true;
145+
submitButton.classList.add('opacity-60', 'cursor-not-allowed');
146+
}
147+
148+
updateContactFormStatus(statusElement, 'Email contact is temporarily unavailable while we set up the inbox.', true);
149+
return;
150+
}
138151

139152
form.addEventListener('submit', function(e) {
140153
e.preventDefault();
@@ -152,14 +165,14 @@ function setupContactForm() {
152165
}
153166

154167
const mailtoUrl = window.ContactMailto.buildContactMailtoUrl({
155-
to: 'compliance.enlitech@gmail.com',
168+
to: CONTACT_EMAIL,
156169
name: nameInput.value,
157170
email: emailInput.value,
158171
subject: subjectInput.value,
159172
message: messageInput.value
160173
});
161174

162-
updateContactFormStatus(statusElement, 'Opening your email app with a pre-filled message to compliance.enlitech@gmail.com.', false);
175+
updateContactFormStatus(statusElement, 'Opening your email app with a pre-filled message.', false);
163176
window.location.href = mailtoUrl;
164177
});
165178
}

tests/contact-mailto.test.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { buildContactMailtoUrl } = require('../js/contact-mailto.js');
55

66
test('buildContactMailtoUrl includes recipient, subject, and sender details', () => {
77
const url = buildContactMailtoUrl({
8-
to: 'compliance.enlitech@gmail.com',
8+
to: 'contact@example.com',
99
name: 'Ada Lovelace',
1010
email: 'ada@example.com',
1111
subject: 'Partnership Inquiry',
@@ -14,6 +14,19 @@ test('buildContactMailtoUrl includes recipient, subject, and sender details', ()
1414

1515
assert.equal(
1616
url,
17-
'mailto:compliance.enlitech@gmail.com?subject=Partnership%20Inquiry&body=Name%3A%20Ada%20Lovelace%0AEmail%3A%20ada%40example.com%0A%0AMessage%3A%0AI%20would%20like%20to%20learn%20more%20about%20your%20compliance%20process.'
17+
'mailto:contact@example.com?subject=Partnership%20Inquiry&body=Name%3A%20Ada%20Lovelace%0AEmail%3A%20ada%40example.com%0A%0AMessage%3A%0AI%20would%20like%20to%20learn%20more%20about%20your%20compliance%20process.'
18+
);
19+
});
20+
21+
test('buildContactMailtoUrl rejects missing recipients', () => {
22+
assert.throws(
23+
() => buildContactMailtoUrl({
24+
to: '',
25+
name: 'Ada Lovelace',
26+
email: 'ada@example.com',
27+
subject: 'Partnership Inquiry',
28+
message: 'Hello'
29+
}),
30+
/recipient email is not configured/i
1831
);
1932
});

0 commit comments

Comments
 (0)