
import { sendOpportunityEmail } from '../common/utils/email.service.js';

const test = async () => {
    console.log('Starting email test...');
    try {
        // Wait for transporter to initialize (it's async in the module)
        // In a real app, the server startup time usually covers this, but for a script we might race.
        // The current implementation of email.service.ts doesn't export the promise, so we might need to hack a delay.
        console.log('Waiting for transporter initialization...');
        await new Promise(resolve => setTimeout(resolve, 3000));

        await sendOpportunityEmail('test@example.com', 'Test User', 'Test City', 'APP-TEST-123');
        console.log('Email send function called.');
    } catch (error) {
        console.error('Test failed:', error);
    }
};

test();
