mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
45 lines
983 B
TypeScript
45 lines
983 B
TypeScript
|
|
export const INotificationRepository = 'INotificationRepository';
|
||
|
|
|
||
|
|
export type SendEmailOptions = {
|
||
|
|
from: string;
|
||
|
|
to: string;
|
||
|
|
replyTo?: string;
|
||
|
|
subject: string;
|
||
|
|
html: string;
|
||
|
|
text: string;
|
||
|
|
smtp: SmtpOptions;
|
||
|
|
};
|
||
|
|
|
||
|
|
export type SmtpOptions = {
|
||
|
|
host: string;
|
||
|
|
port?: number;
|
||
|
|
username?: string;
|
||
|
|
password?: string;
|
||
|
|
ignoreCert?: boolean;
|
||
|
|
};
|
||
|
|
|
||
|
|
export enum EmailTemplate {
|
||
|
|
WELCOME = 'welcome',
|
||
|
|
RESET_PASSWORD = 'reset-password',
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface WelcomeEmailProps {
|
||
|
|
baseUrl: string;
|
||
|
|
displayName: string;
|
||
|
|
username: string;
|
||
|
|
password?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export type EmailRenderRequest = { template: EmailTemplate.WELCOME; data: WelcomeEmailProps };
|
||
|
|
|
||
|
|
export type SendEmailResponse = {
|
||
|
|
messageId: string;
|
||
|
|
response: any;
|
||
|
|
};
|
||
|
|
|
||
|
|
export interface INotificationRepository {
|
||
|
|
renderEmail(request: EmailRenderRequest): { html: string; text: string };
|
||
|
|
sendEmail(options: SendEmailOptions): Promise<SendEmailResponse>;
|
||
|
|
verifySmtp(options: SmtpOptions): Promise<true>;
|
||
|
|
}
|