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

50 lines
915 B
TypeScript
Raw Normal View History

2021-03-12 09:22:17 +00:00
type From = string | { name?: string, address: string }
2020-04-23 07:32:53 +00:00
2021-03-12 09:22:17 +00:00
interface Base extends Partial<SendEmailDefaultMessageOptions> {
to: string[] | string
}
interface MailTemplate extends Base {
template: string
locals?: { [key: string]: any }
2021-03-12 09:22:17 +00:00
text?: undefined
}
interface MailText extends Base {
text: string
2021-03-12 09:22:17 +00:00
locals?: Partial<SendEmailDefaultLocalsOptions> & {
title?: string
action?: {
url: string
text: string
}
}
2020-04-23 07:32:53 +00:00
}
2021-03-12 09:22:17 +00: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