diff options
Diffstat (limited to 'server/lib/emailer.ts')
-rw-r--r-- | server/lib/emailer.ts | 18 |
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 | ||