@allthings/cloud-toolkit
Version:
Standardizes the setup of aws, datadog and other things
36 lines (35 loc) • 1.2 kB
TypeScript
import * as aws from '@aws-sdk/client-ses';
import { Headers } from 'nodemailer/lib/mailer';
import { Logger } from 'winston';
export interface ISES {
clientConfig?: aws.SESClientConfig;
customSMTPConfig?: {
host: string;
port: number;
secure: boolean;
};
logger?: Logger;
}
export declare const DEFAULT_CLIENT_CONFIG: ISES;
export interface IEmailAttachment {
readonly content: string | Buffer | NodeJS.ReadableStream;
readonly contentType: string;
readonly filename: string;
}
export interface IEmailOptions {
readonly attachments?: readonly IEmailAttachment[];
readonly bcc?: string | readonly string[];
readonly cc?: string | readonly string[];
readonly from?: string;
readonly headers?: Headers;
readonly html?: string;
readonly replyTo?: string | readonly string[];
readonly subject: string;
readonly text?: string;
readonly to: string | readonly string[];
}
export type TSendMail = (options: IEmailOptions, responseCallback?: (response: object) => Promise<void>) => Promise<boolean>;
declare const ses: (fromEmailAddress: string, userConfig: ISES) => {
sendMail: TSendMail;
};
export default ses;