UNPKG

@api-buddy/sendgrid

Version:

API Buddy integration for SendGrid - Email delivery service for transactional and marketing emails

46 lines (45 loc) 1.46 kB
import { SendGridConfig, EmailOptions, BatchSendGridResponse } from './types'; export declare class SendGridClient { private config; private initialized; constructor(config: SendGridConfig); /** * Initialize the SendGrid client with the API key */ private initialize; /** * Send an email using SendGrid * @param options Email options * @returns Promise with the SendGrid response */ sendEmail(options: EmailOptions): Promise<{ success: boolean; statusCode: number; headers: any; body: object; }>; /** * Send multiple emails in a single request * @param messages Array of email options * @returns Promise with the SendGrid response */ sendMultipleEmails(messages: EmailOptions[]): Promise<BatchSendGridResponse>; } export declare const sendGridClient: SendGridClient; /** * Send an email using the default SendGrid client * @param options Email options * @returns Promise with the SendGrid response */ export declare const sendEmail: (options: EmailOptions) => Promise<{ success: boolean; statusCode: number; headers: any; body: object; }>; /** * Send multiple emails in a single request using the default SendGrid client * @param messages Array of email options * @returns Promise with the SendGrid response */ export declare const sendMultipleEmails: (messages: EmailOptions[]) => Promise<BatchSendGridResponse>;