Contact form logic

This commit is contained in:
becarta
2025-03-04 00:32:39 +01:00
parent 9c61657071
commit e9d3d8a2fb
21 changed files with 2210 additions and 14 deletions

31
test-email.ts Normal file
View File

@@ -0,0 +1,31 @@
import { testEmailConfiguration, sendAdminNotification } from './src/utils/email-handler.js';
import 'dotenv/config';
async function runEmailTest() {
console.log('Starting email configuration test...');
// Test the SMTP connection
const configTest = await testEmailConfiguration();
console.log(`Configuration test result: ${configTest ? 'SUCCESS' : 'FAILED'}`);
if (configTest) {
// Try sending a test email
console.log('Attempting to send a test email...');
const emailResult = await sendAdminNotification(
'Test User',
'test@example.com',
'This is a test message sent at ' + new Date().toISOString(),
'127.0.0.1',
'Email Test Script'
);
console.log(`Test email result: ${emailResult ? 'SENT' : 'FAILED'}`);
}
console.log('Email test completed');
}
runEmailTest().catch(error => {
console.error('Error running email test:', error);
process.exit(1);
});