import { VideoImportModel } from '../models/video/video-import'
import { ActorFollowModel } from '../models/activitypub/actor-follow'
+type SendEmailOptions = {
+ to: string[]
+ subject: string
+ text: string
+
+ fromDisplayName?: string
+ replyTo?: string
+}
+
class Emailer {
private static instance: Emailer
return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload })
}
+ addVideoAutoBlacklistModeratorsNotification (to: string[], video: VideoModel) {
+ const VIDEO_AUTO_BLACKLIST_URL = CONFIG.WEBSERVER.URL + '/admin/moderation/video-auto-blacklist/list'
+ const videoUrl = CONFIG.WEBSERVER.URL + video.getWatchStaticPath()
+
+ const text = `Hi,\n\n` +
+ `A recently added video was auto-blacklisted and requires moderator review before publishing.` +
+ `\n\n` +
+ `You can view it and take appropriate action on ${videoUrl}` +
+ `\n\n` +
+ `A full list of auto-blacklisted videos can be reviewed here: ${VIDEO_AUTO_BLACKLIST_URL}` +
+ `\n\n` +
+ `Cheers,\n` +
+ `PeerTube.`
+
+ const emailPayload: EmailPayload = {
+ to,
+ subject: '[PeerTube] An auto-blacklisted video is awaiting review',
+ text
+ }
+
+ return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload })
+ }
+
addNewUserRegistrationNotification (to: string[], user: UserModel) {
const text = `Hi,\n\n` +
`User ${user.username} just registered on ${CONFIG.WEBSERVER.HOST} PeerTube instance.\n\n` +
// ---------------------------------------------------------------------------
export {
- Emailer
+ Emailer,
+ SendEmailOptions
}