strapi-provider-email-multichannel
Version:
Strapi email provider for supporting multiple email channels
39 lines (38 loc) • 941 B
TypeScript
import nodemailer from 'nodemailer';
import SMTPTransport from 'nodemailer/lib/smtp-transport';
interface Settings {
defaultFrom: string;
defaultReplyTo: string;
defaultFromName: string;
}
interface SendOptions {
from?: string;
to: string;
cc?: string;
bcc?: string;
replyTo?: string;
subject: string;
text: string;
html: string;
channel?: string;
[key: string]: unknown;
}
type NodemailerSMTPOptions = Parameters<typeof nodemailer.createTransport<SMTPTransport>>[0];
type ChannelOptions = {
type: 'brevo';
options: {
apiKey: string;
};
} | {
type: 'smtp';
options: NodemailerSMTPOptions;
};
type ProviderOptions = {
defaultChannel: string;
channels: Record<string, ChannelOptions>;
debug?: boolean;
};
export declare function init(providerOptions: ProviderOptions, settings: Settings): {
send(options: SendOptions): Promise<any>;
};
export {};