From 916937d7daf386e4e2d37b2ca22db07b644b02df Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 22 Aug 2019 10:22:01 +0200 Subject: [PATCH] email object -> email subject --- config/default.yaml | 2 +- config/production.yaml.example | 2 +- server/initializers/checker-before-init.ts | 2 +- server/initializers/config.ts | 4 +-- server/lib/emailer.ts | 34 +++++++++++----------- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/config/default.yaml b/config/default.yaml index b7a433b99..dfba23f59 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -64,7 +64,7 @@ smtp: email: body: signature: "PeerTube" - object: + subject: prefix: "[PeerTube]" # From the project root directory diff --git a/config/production.yaml.example b/config/production.yaml.example index 17a1be502..267186e08 100644 --- a/config/production.yaml.example +++ b/config/production.yaml.example @@ -65,7 +65,7 @@ smtp: email: body: signature: "PeerTube" - object: + subject: prefix: "[PeerTube]" # From the project root directory diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts index 55bc820f5..a986c3e0e 100644 --- a/server/initializers/checker-before-init.ts +++ b/server/initializers/checker-before-init.ts @@ -11,7 +11,7 @@ function checkMissedConfig () { 'trust_proxy', 'database.hostname', 'database.port', 'database.suffix', 'database.username', 'database.password', 'database.pool.max', 'smtp.hostname', 'smtp.port', 'smtp.username', 'smtp.password', 'smtp.tls', 'smtp.from_address', - 'email.body.signature', 'email.object.prefix', + 'email.body.signature', 'email.subject.prefix', 'storage.avatars', 'storage.videos', 'storage.logs', 'storage.previews', 'storage.thumbnails', 'storage.torrents', 'storage.cache', 'storage.redundancy', 'storage.tmp', 'storage.streaming_playlists', 'storage.plugins', 'log.level', diff --git a/server/initializers/config.ts b/server/initializers/config.ts index 58241e4ea..510f7d64d 100644 --- a/server/initializers/config.ts +++ b/server/initializers/config.ts @@ -48,8 +48,8 @@ const CONFIG = { BODY: { SIGNATURE: config.get('email.body.signature') }, - OBJECT: { - PREFIX: config.get('email.object.prefix') + ' ' + SUBJECT: { + PREFIX: config.get('email.subject.prefix') + ' ' } }, STORAGE: { diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index 73c2bcb1b..10e7d0479 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts @@ -104,7 +104,7 @@ class Emailer { const emailPayload: EmailPayload = { to, - subject: CONFIG.EMAIL.OBJECT.PREFIX + channelName + ' just published a new video', + subject: CONFIG.EMAIL.SUBJECT.PREFIX + channelName + ' just published a new video', text } @@ -123,7 +123,7 @@ class Emailer { const emailPayload: EmailPayload = { to, - subject: CONFIG.EMAIL.OBJECT.PREFIX + 'New follower on your channel ' + followingName, + subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'New follower on your channel ' + followingName, text } @@ -141,7 +141,7 @@ class Emailer { const emailPayload: EmailPayload = { to, - subject: CONFIG.EMAIL.OBJECT.PREFIX + 'New instance follower', + subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'New instance follower', text } @@ -161,7 +161,7 @@ class Emailer { const emailPayload: EmailPayload = { to, - subject: CONFIG.EMAIL.OBJECT.PREFIX + `Your video ${video.name} is published`, + subject: CONFIG.EMAIL.SUBJECT.PREFIX + `Your video ${video.name} is published`, text } @@ -181,7 +181,7 @@ class Emailer { const emailPayload: EmailPayload = { to, - subject: CONFIG.EMAIL.OBJECT.PREFIX + `Your video import ${videoImport.getTargetIdentifier()} is finished`, + subject: CONFIG.EMAIL.SUBJECT.PREFIX + `Your video import ${videoImport.getTargetIdentifier()} is finished`, text } @@ -201,7 +201,7 @@ class Emailer { const emailPayload: EmailPayload = { to, - subject: CONFIG.EMAIL.OBJECT.PREFIX + `Your video import ${videoImport.getTargetIdentifier()} encountered an error`, + subject: CONFIG.EMAIL.SUBJECT.PREFIX + `Your video import ${videoImport.getTargetIdentifier()} encountered an error`, text } @@ -223,7 +223,7 @@ class Emailer { const emailPayload: EmailPayload = { to, - subject: CONFIG.EMAIL.OBJECT.PREFIX + 'New comment on your video ' + video.name, + subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'New comment on your video ' + video.name, text } @@ -245,7 +245,7 @@ class Emailer { const emailPayload: EmailPayload = { to, - subject: CONFIG.EMAIL.OBJECT.PREFIX + 'Mention on video ' + video.name, + subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'Mention on video ' + video.name, text } @@ -262,7 +262,7 @@ class Emailer { const emailPayload: EmailPayload = { to, - subject: CONFIG.EMAIL.OBJECT.PREFIX + 'Received a video abuse', + subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'Received a video abuse', text } @@ -285,7 +285,7 @@ class Emailer { const emailPayload: EmailPayload = { to, - subject: CONFIG.EMAIL.OBJECT.PREFIX + 'An auto-blacklisted video is awaiting review', + subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'An auto-blacklisted video is awaiting review', text } @@ -300,7 +300,7 @@ class Emailer { const emailPayload: EmailPayload = { to, - subject: CONFIG.EMAIL.OBJECT.PREFIX + 'New user registration on ' + WEBSERVER.HOST, + subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'New user registration on ' + WEBSERVER.HOST, text } @@ -322,7 +322,7 @@ class Emailer { const emailPayload: EmailPayload = { to, - subject: CONFIG.EMAIL.OBJECT.PREFIX + `Video ${videoName} blacklisted`, + subject: CONFIG.EMAIL.SUBJECT.PREFIX + `Video ${videoName} blacklisted`, text } @@ -340,7 +340,7 @@ class Emailer { const emailPayload: EmailPayload = { to, - subject: CONFIG.EMAIL.OBJECT.PREFIX + `Video ${video.name} unblacklisted`, + subject: CONFIG.EMAIL.SUBJECT.PREFIX + `Video ${video.name} unblacklisted`, text } @@ -357,7 +357,7 @@ class Emailer { const emailPayload: EmailPayload = { to: [ to ], - subject: CONFIG.EMAIL.OBJECT.PREFIX + 'Reset your password', + subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'Reset your password', text } @@ -374,7 +374,7 @@ class Emailer { const emailPayload: EmailPayload = { to: [ to ], - subject: CONFIG.EMAIL.OBJECT.PREFIX + 'Verify your email', + subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'Verify your email', text } @@ -395,7 +395,7 @@ class Emailer { const to = user.email const emailPayload: EmailPayload = { to: [ to ], - subject: CONFIG.EMAIL.OBJECT.PREFIX + 'Account ' + blockedWord, + subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'Account ' + blockedWord, text } @@ -415,7 +415,7 @@ class Emailer { fromDisplayName: fromEmail, replyTo: fromEmail, to: [ CONFIG.ADMIN.EMAIL ], - subject: CONFIG.EMAIL.OBJECT.PREFIX + subject, + subject: CONFIG.EMAIL.SUBJECT.PREFIX + subject, text } -- 2.25.1