2025-07-27 15:27:24 +08:00
|
|
|
/**
|
2025-07-27 17:17:15 +08:00
|
|
|
* Send test email reply to relay service
|
2025-07-27 15:27:24 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
const nodemailer = require('nodemailer');
|
|
|
|
|
require('dotenv').config();
|
|
|
|
|
|
|
|
|
|
async function sendTestReply() {
|
2025-07-27 17:17:15 +08:00
|
|
|
console.log('📧 Sending test email reply...\n');
|
2025-07-27 15:27:24 +08:00
|
|
|
|
2025-07-27 17:17:15 +08:00
|
|
|
// Create test SMTP transporter (using Gmail)
|
2025-07-27 15:27:24 +08:00
|
|
|
const transporter = nodemailer.createTransport({
|
|
|
|
|
service: 'gmail',
|
|
|
|
|
auth: {
|
|
|
|
|
user: 'jiaxicui446@gmail.com',
|
|
|
|
|
pass: process.env.GMAIL_APP_PASSWORD || 'your-app-password'
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2025-07-27 17:17:15 +08:00
|
|
|
// Use latest token
|
|
|
|
|
const testToken = 'V5UPZ1UE'; // Latest token from session-map.json
|
2025-07-27 15:27:24 +08:00
|
|
|
|
|
|
|
|
const mailOptions = {
|
|
|
|
|
from: 'jiaxicui446@gmail.com',
|
|
|
|
|
to: 'noreply@pandalla.ai',
|
2025-07-27 17:17:15 +08:00
|
|
|
subject: `Re: [TaskPing #${testToken}] Claude Code Task Completed - TaskPing`,
|
|
|
|
|
text: 'Please explain the basic principles of quantum computing',
|
2025-07-27 15:27:24 +08:00
|
|
|
replyTo: 'jiaxicui446@gmail.com'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const info = await transporter.sendMail(mailOptions);
|
2025-07-27 17:17:15 +08:00
|
|
|
console.log('✅ Test email sent successfully!');
|
2025-07-27 15:27:24 +08:00
|
|
|
console.log(`📧 Message ID: ${info.messageId}`);
|
|
|
|
|
console.log(`📋 Token: ${testToken}`);
|
|
|
|
|
console.log(`💬 Command: ${mailOptions.text}`);
|
2025-07-27 17:17:15 +08:00
|
|
|
console.log('\n🔍 Now monitoring relay service logs...');
|
2025-07-27 15:27:24 +08:00
|
|
|
|
2025-07-27 17:17:15 +08:00
|
|
|
// Wait a few seconds for email processing
|
2025-07-27 15:27:24 +08:00
|
|
|
setTimeout(() => {
|
2025-07-27 17:17:15 +08:00
|
|
|
console.log('\n📋 Please check relay-debug.log file for processing logs');
|
2025-07-27 15:27:24 +08:00
|
|
|
}, 5000);
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
2025-07-27 17:17:15 +08:00
|
|
|
console.error('❌ Email sending failed:', error.message);
|
2025-07-27 15:27:24 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sendTestReply().catch(console.error);
|