()
| 18 | |
| 19 | // Example 1: Send a simple email (similar to your original sendMail function) |
| 20 | async function sendSimpleEmail() { |
| 21 | try { |
| 22 | console.log('📧 Sending simple email via Brevo...'); |
| 23 | |
| 24 | const result = await emailService.sendMail({ |
| 25 | to: 'user@example.com', |
| 26 | subject: 'Hello from Brevo!', |
| 27 | html: '<h1>Hello World!</h1><p>This email was sent using your existing Brevo implementation.</p>', |
| 28 | }); |
| 29 | |
| 30 | if (result.success) { |
| 31 | console.log('✅ Email sent successfully!', result.messageId); |
| 32 | } else { |
| 33 | console.error('❌ Failed to send email:', result.error); |
| 34 | } |
| 35 | } catch (error) { |
| 36 | console.error('❌ Error:', error.message); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | // Example 2: Send welcome email using template |
| 41 | async function sendWelcomeEmail() { |
no test coverage detected