aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/emailer.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-08 17:26:01 +0200
committerChocobozzz <me@florianbigard.com>2019-04-08 17:30:48 +0200
commit883993c81ecc2388d4a4b37b29b81b6de73d264f (patch)
treef0f76995b6762b10a0c1a7ccc2b5d952f68014ea /server/lib/emailer.ts
parent0dc647775881eb1378b213a530996cd096de24ea (diff)
downloadPeerTube-883993c81ecc2388d4a4b37b29b81b6de73d264f.tar.gz
PeerTube-883993c81ecc2388d4a4b37b29b81b6de73d264f.tar.zst
PeerTube-883993c81ecc2388d4a4b37b29b81b6de73d264f.zip
Add notification on new instance follower (server side)
Diffstat (limited to 'server/lib/emailer.ts')
-rw-r--r--server/lib/emailer.ts18
1 files changed, 18 insertions, 0 deletions
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 {
129 return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload }) 129 return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload })
130 } 130 }
131 131
132 addNewInstanceFollowerNotification (to: string[], actorFollow: ActorFollowModel) {
133 const awaitingApproval = actorFollow.state === 'pending' ? ' awaiting manual approval.' : ''
134
135 const text = `Hi dear admin,\n\n` +
136 `Your instance has a new follower: ${actorFollow.ActorFollower.url}${awaitingApproval}` +
137 `\n\n` +
138 `Cheers,\n` +
139 `PeerTube.`
140
141 const emailPayload: EmailPayload = {
142 to,
143 subject: 'New instance follower',
144 text
145 }
146
147 return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload })
148 }
149
132 myVideoPublishedNotification (to: string[], video: VideoModel) { 150 myVideoPublishedNotification (to: string[], video: VideoModel) {
133 const videoUrl = CONFIG.WEBSERVER.URL + video.getWatchStaticPath() 151 const videoUrl = CONFIG.WEBSERVER.URL + video.getWatchStaticPath()
134 152