()
| 83 | |
| 84 | // Example 4: Send to multiple recipients |
| 85 | async function sendBulkEmail() { |
| 86 | try { |
| 87 | console.log('📧 Sending bulk email via Brevo...'); |
| 88 | |
| 89 | const result = await emailService.sendMail({ |
| 90 | to: ['user1@example.com', 'user2@example.com', 'user3@example.com'], |
| 91 | subject: 'Important Update', |
| 92 | html: ` |
| 93 | <div style="font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto;"> |
| 94 | <h1 style="color: #333;">Important Update</h1> |
| 95 | <p>Dear valued user,</p> |
| 96 | <p>We have an important update regarding our service.</p> |
| 97 | <p>Best regards,<br>The Pollinations AI Team</p> |
| 98 | </div> |
| 99 | `, |
| 100 | }); |
| 101 | |
| 102 | if (result.success) { |
| 103 | console.log('✅ Bulk email sent successfully!', result.messageId); |
| 104 | } else { |
| 105 | console.error('❌ Failed to send bulk email:', result.error); |
| 106 | } |
| 107 | } catch (error) { |
| 108 | console.error('❌ Error:', error.message); |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | // Example 5: Verify Brevo connection |
| 113 | async function verifyBrevoConnection() { |
no test coverage detected