@leanstacks/serverless-common
Version:
LeanStacks organization common serverless components.
40 lines (39 loc) • 945 B
TypeScript
/**
* The addresses to which the email should be sent.
*/
export type EmailDestination = {
to: string[];
cc?: string[];
bcc?: string[];
};
/**
* An object containing data to populate the email template. The object keys
* are strings and the values may be strings, numbers, or booleans.
*
* _Example:_
* ```
* {
* name: 'Joe Smith',
* age: 39,
* isEnabled: true
* }
* ```
*/
export type EmailTemplateData = Record<string, string | number | boolean>;
/**
* The `Email` type describes the request to send an email to one or more
* recipients (i.e. destinations).
*/
export type Email = {
destinations: EmailDestination[];
templateName: string;
templateData?: EmailTemplateData;
};
/**
* Use the `EmailService` to send an email message. Messages are sent
* asynchronously.
*/
declare const EmailService: {
send: (email: Email, queueUrl: string) => Promise<void>;
};
export default EmailService;