Files
lib-mailing/dist/server/index.d.ts
2026-04-01 15:16:25 +02:00

28 lines
868 B
TypeScript

type PostalMessageInput = {
to: string[];
subject: string;
plainBody: string;
htmlBody: string;
};
type PostalClient = {
enabled: boolean;
sendMessage: (input: PostalMessageInput) => Promise<void>;
};
type CreatePostalClientOptions = {
baseUrl: string;
apiKey: string;
from: string;
fetchImpl?: typeof fetch;
};
type CreatePostalClientFromEnvOptions = {
baseUrlEnv?: string;
apiKeyEnv?: string;
fromEnv?: string;
env?: Record<string, string | undefined>;
fetchImpl?: typeof fetch;
};
declare function createPostalClient(options: CreatePostalClientOptions): PostalClient;
declare function createPostalClientFromEnv(options?: CreatePostalClientFromEnvOptions): PostalClient;
export { type CreatePostalClientOptions, type PostalClient, type PostalMessageInput, createPostalClient, createPostalClientFromEnv };