diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2018-10-06 13:54:00 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-02-11 09:26:29 +0100 |
commit | 328c78bc4a570a9aceaaa1a2124bacd4a0e8d295 (patch) | |
tree | 7f07a427828fb5540dfe7e6bed372e846d587b86 /server/lib/emailer.ts | |
parent | c7ca4c8be781753f86d806015b182f1ee5443fcf (diff) | |
download | PeerTube-328c78bc4a570a9aceaaa1a2124bacd4a0e8d295.tar.gz PeerTube-328c78bc4a570a9aceaaa1a2124bacd4a0e8d295.tar.zst PeerTube-328c78bc4a570a9aceaaa1a2124bacd4a0e8d295.zip |
allow administration to change/reset a user's password
Diffstat (limited to 'server/lib/emailer.ts')
-rw-r--r-- | server/lib/emailer.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index f384a254e..7681164b3 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts | |||
@@ -101,6 +101,22 @@ class Emailer { | |||
101 | return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload }) | 101 | return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload }) |
102 | } | 102 | } |
103 | 103 | ||
104 | addForceResetPasswordEmailJob (to: string, resetPasswordUrl: string) { | ||
105 | const text = `Hi dear user,\n\n` + | ||
106 | `Your password has been reset on ${CONFIG.WEBSERVER.HOST}! ` + | ||
107 | `Please follow this link to reset it: ${resetPasswordUrl}\n\n` + | ||
108 | `Cheers,\n` + | ||
109 | `PeerTube.` | ||
110 | |||
111 | const emailPayload: EmailPayload = { | ||
112 | to: [ to ], | ||
113 | subject: 'Reset of your PeerTube password', | ||
114 | text | ||
115 | } | ||
116 | |||
117 | return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload }) | ||
118 | } | ||
119 | |||
104 | addNewFollowNotification (to: string[], actorFollow: ActorFollowModel, followType: 'account' | 'channel') { | 120 | addNewFollowNotification (to: string[], actorFollow: ActorFollowModel, followType: 'account' | 'channel') { |
105 | const followerName = actorFollow.ActorFollower.Account.getDisplayName() | 121 | const followerName = actorFollow.ActorFollower.Account.getDisplayName() |
106 | const followingName = (actorFollow.ActorFollowing.VideoChannel || actorFollow.ActorFollowing.Account).getDisplayName() | 122 | const followingName = (actorFollow.ActorFollowing.VideoChannel || actorFollow.ActorFollowing.Account).getDisplayName() |