@strapi/provider-email-amazon-ses
Version:
Amazon SES provider for strapi email
53 lines • 2.21 kB
TypeScript
import type { SendEmailCommandInput, SESClientConfig } from '@aws-sdk/client-ses';
/** Default SES API host when `amazon` is omitted (same as legacy node-ses). */
export declare const DEFAULT_SES_ENDPOINT = "https://email.us-east-1.amazonaws.com";
export declare const SES_ENDPOINT_REGION_PATTERN: RegExp;
export interface ProviderCredentials {
key: string;
secret: string;
sessionToken?: string;
}
export interface ProviderOptions extends Omit<SESClientConfig, 'credentials'> {
credentials?: ProviderCredentials | NonNullable<SESClientConfig['credentials']>;
key?: string;
secret?: string;
amazon?: string;
}
export interface ProviderSettings {
defaultFrom: string;
defaultReplyTo: string | string[];
}
export interface SendOptions {
from?: string;
to: string | string[];
cc?: string | string[];
bcc?: string | string[];
replyTo?: string | string[];
subject: string;
text: string;
html: string;
[key: string]: unknown;
}
type EndpointInput = string | SESClientConfig['endpoint'];
export declare const regionFromEndpoint: (endpoint?: EndpointInput) => string | undefined;
/** Matches node-ses `extractRecipient`: arrays pass through, strings become a single entry. */
export declare const toAddressList: (value?: string | string[]) => string[] | undefined;
export interface LegacyMessageTag {
name: string;
value: string;
}
/**
* Maps legacy node-ses `providerOptions` and AWS SDK v3 `SESClient` config.
*
* Rewrites:
* - `key` / `secret` → `credentials.accessKeyId` / `credentials.secretAccessKey`
* - `credentials: { key, secret }` → AWS credential object
* - `amazon` → `endpoint`
* - region from `amazon` / `endpoint` host (`email.<region>.amazonaws.com`)
* - `key` + `secret` only → `region: us-east-1` (node-ses default endpoint behavior)
*/
export declare const getClientConfig: (providerOptions: ProviderOptions) => SESClientConfig;
/** Builds SendEmail input (html → Html body, text → Text body; legacy node-ses message/altText). */
export declare const buildSendEmailCommandInput: (options: SendOptions, settings: ProviderSettings) => SendEmailCommandInput;
export {};
//# sourceMappingURL=utils.d.ts.map