1
0
Fork 0
peertube/shared/models/server/emailer.model.ts

50 lines
915 B
TypeScript
Raw Normal View History

2021-03-12 04:22:17 -05:00
type From = string | { name?: string, address: string }
2020-04-23 03:32:53 -04:00
2021-03-12 04:22:17 -05:00
interface Base extends Partial<SendEmailDefaultMessageOptions> {
to: string[] | string
}
interface MailTemplate extends Base {
template: string
locals?: { [key: string]: any }
2021-03-12 04:22:17 -05:00
text?: undefined
}
interface MailText extends Base {
text: string
2021-03-12 04:22:17 -05:00
locals?: Partial<SendEmailDefaultLocalsOptions> & {
title?: string
action?: {
url: string
text: string
}
}
2020-04-23 03:32:53 -04:00
}
2021-03-12 04:22:17 -05:00
interface SendEmailDefaultLocalsOptions {
instanceName: string
text: string
subject: string
}
interface SendEmailDefaultMessageOptions {
to: string[] | string
from: From
subject: string
replyTo: string
}
export type SendEmailDefaultOptions = {
template: 'common'
message: SendEmailDefaultMessageOptions
locals: SendEmailDefaultLocalsOptions & {
WEBSERVER: any
EMAIL: any
}
}
export type SendEmailOptions = MailTemplate | MailText