-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-email.js
More file actions
44 lines (37 loc) · 1.21 KB
/
Copy pathtest-email.js
File metadata and controls
44 lines (37 loc) · 1.21 KB
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
// Quick test script for email system
const fetch = require('node-fetch');
async function testEmailSystem() {
const url = 'http://localhost:3010/api/email/send';
const testEmail = {
type: 'simple',
to: 'test@example.com',
subject: 'NextSaaS Email Test',
html: '<h1>🎉 Success!</h1><p>Your NextSaaS email system is working!</p>',
text: 'Success! Your NextSaaS email system is working!',
organizationId: 'test-org-123'
};
try {
console.log('🧪 Testing NextSaaS Email System...');
console.log('📍 URL:', url);
console.log('📧 Email:', testEmail);
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(testEmail)
});
const result = await response.json();
if (response.ok) {
console.log('✅ Email sent successfully!');
console.log('📊 Result:', result);
} else {
console.log('❌ Email failed to send');
console.log('🐛 Error:', result);
}
} catch (error) {
console.log('🔴 Connection failed:', error.message);
console.log('💡 Make sure the NextSaaS app is running on port 3010');
}
}
testEmailSystem();