@api-buddy/sendgrid
Version:
API Buddy integration for SendGrid - Email delivery service for transactional and marketing emails
24 lines (23 loc) • 842 B
TypeScript
import { EmailOptions, SendGridResponse, SendGridError, BatchSendGridResponse } from '../types';
/**
* Hook for sending emails with SendGrid
* @returns Object containing the send function, loading state, and error state
*/
export declare function useSendEmail(): {
send: (options: EmailOptions) => Promise<SendGridResponse>;
isLoading: boolean;
error: SendGridError | null;
response: SendGridResponse | null;
reset: () => void;
};
/**
* Hook for sending multiple emails with SendGrid
* @returns Object containing the send function, loading state, and error state
*/
export declare function useSendMultipleEmails(): {
send: (messages: EmailOptions[]) => Promise<BatchSendGridResponse>;
isLoading: boolean;
error: SendGridError | null;
response: BatchSendGridResponse | null;
reset: () => void;
};