From 883993c81ecc2388d4a4b37b29b81b6de73d264f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 8 Apr 2019 17:26:01 +0200 Subject: Add notification on new instance follower (server side) --- server/lib/emailer.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'server/lib/emailer.ts') diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index eec97c27e..aa9083362 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts @@ -129,6 +129,24 @@ class Emailer { return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload }) } + addNewInstanceFollowerNotification (to: string[], actorFollow: ActorFollowModel) { + const awaitingApproval = actorFollow.state === 'pending' ? ' awaiting manual approval.' : '' + + const text = `Hi dear admin,\n\n` + + `Your instance has a new follower: ${actorFollow.ActorFollower.url}${awaitingApproval}` + + `\n\n` + + `Cheers,\n` + + `PeerTube.` + + const emailPayload: EmailPayload = { + to, + subject: 'New instance follower', + text + } + + return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload }) + } + myVideoPublishedNotification (to: string[], video: VideoModel) { const videoUrl = CONFIG.WEBSERVER.URL + video.getWatchStaticPath() -- cgit v1.2.3