UNPKG

@microfox/aws-ses

Version:
74 lines (71 loc) 2.35 kB
import { z } from 'zod'; declare const SendEmailResponseSchema: z.ZodObject<{ SendEmailResponse: z.ZodObject<{ SendEmailResult: z.ZodObject<{ MessageId: z.ZodString; }, z.core.$strip>; ResponseMetadata: z.ZodObject<{ RequestId: z.ZodString; }, z.core.$strip>; }, z.core.$strip>; }, z.core.$loose>; declare const SESConfigSchema: z.ZodObject<{ accessKeyId: z.ZodString; secretAccessKey: z.ZodString; region: z.ZodString; }, z.core.$strip>; declare const EmailParamsSchema: z.ZodObject<{ sender: z.ZodString; recipient: z.ZodString; displayName: z.ZodOptional<z.ZodString>; subject: z.ZodString; bodyText: z.ZodOptional<z.ZodString>; bodyHtml: z.ZodOptional<z.ZodString>; }, z.core.$strip>; declare const BulkEmailParamsSchema: z.ZodObject<{ sender: z.ZodString; recipients: z.ZodArray<z.ZodString>; displayName: z.ZodOptional<z.ZodString>; subject: z.ZodString; bodyText: z.ZodOptional<z.ZodString>; bodyHtml: z.ZodOptional<z.ZodString>; }, z.core.$strip>; type SESConfig = z.infer<typeof SESConfigSchema>; type EmailParams = z.infer<typeof EmailParamsSchema>; type BulkEmailParams = z.infer<typeof BulkEmailParamsSchema>; type SendEmailResponse = z.infer<typeof SendEmailResponseSchema>; declare const SESSdkSchema: z.ZodObject<{ sendEmail: z.ZodAny; sendBulkEmails: z.ZodAny; }, z.core.$strip>; type SESSDK = z.infer<typeof SESSdkSchema>; /** * Create an AWS SES SDK instance for sending emails. * * @example * ```typescript * const ses = createSESSdk({ * accessKeyId: 'YOUR_AWS_ACCESS_KEY_ID', * secretAccessKey: 'YOUR_AWS_SECRET_ACCESS_KEY', * region: 'us-east-1' * }); * * // Send a plain text email * await ses.sendEmail({ * sender: 'sender@example.com', * recipient: 'recipient@example.com', * subject: 'Hello!', * bodyText: 'This is a plain text email' * }); * * // Send an HTML email * await ses.sendEmail({ * sender: 'sender@example.com', * recipient: 'recipient@example.com', * subject: 'Hello!', * bodyHtml: '<p>This is an HTML email</p>' * }); * ``` */ declare const createSESSdk: (config: SESConfig) => SESSDK; export { type BulkEmailParams, type EmailParams, type SESConfig, type SESSDK, type SendEmailResponse, createSESSdk, createSESSdk as default };