MCPcopy Create free account
hub / github.com/pollinations/pollinations / sendMail

Method sendMail

apps/micro/src/services/emailService.ts:20–35  ·  view source on GitHub ↗
(message: EmailMessage)

Source from the content-addressed store, hash-verified

18 }
19
20 async sendMail(message: EmailMessage): Promise<EmailServiceResponse> {
21 try {
22 if (this.config.provider === 'brevo') {
23 return await this.sendViaBrevo(message);
24 } else if (this.config.provider === 'resend') {
25 return await this.sendViaResend(message);
26 } else {
27 throw new Error('No email provider configured');
28 }
29 } catch (error) {
30 return {
31 success: false,
32 error: error instanceof Error ? error.message : 'Unknown error occurred',
33 };
34 }
35 }
36
37 private async sendViaBrevo(message: EmailMessage): Promise<EmailServiceResponse> {
38 if (!this.config.brevo?.apiKey || !this.config.brevo?.senderEmail) {

Callers 1

POSTFunction · 0.95

Calls 2

sendViaBrevoMethod · 0.95
sendViaResendMethod · 0.95

Tested by

no test coverage detected