27 lines
646 B
TypeScript
27 lines
646 B
TypeScript
import { EntityDict } from '../oak-app-domain';
|
|
import { BRC } from '../types/RuntimeCxt';
|
|
import nodemailer from 'nodemailer';
|
|
export type EmailOptions = {
|
|
host?: string;
|
|
port?: number;
|
|
secure?: boolean;
|
|
account?: string;
|
|
password?: string;
|
|
from?: string;
|
|
to?: string;
|
|
subject?: string;
|
|
text?: string;
|
|
html?: string;
|
|
attachments?: nodemailer.SendMailOptions['attachments'];
|
|
};
|
|
/**
|
|
* 邮箱发送
|
|
*/
|
|
export default interface Email<ED extends EntityDict> {
|
|
name: string;
|
|
sendEmail(options: EmailOptions, context: BRC<ED>): Promise<{
|
|
success: boolean;
|
|
error?: string;
|
|
}>;
|
|
}
|