diff options
author | kontrollanten <6680299+kontrollanten@users.noreply.github.com> | 2020-12-11 00:10:37 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-12-14 15:37:29 +0100 |
commit | 2e4b8ae4858616572deec6ebdaa38f20ae96be7a (patch) | |
tree | 18032a014a0b5e90548c6083d440f4e9f4f44338 /server/lib/emailer.ts | |
parent | 915e2bbb97a85b53b4d7b7e2f2d9a416c891a0fb (diff) | |
download | PeerTube-2e4b8ae4858616572deec6ebdaa38f20ae96be7a.tar.gz PeerTube-2e4b8ae4858616572deec6ebdaa38f20ae96be7a.tar.zst PeerTube-2e4b8ae4858616572deec6ebdaa38f20ae96be7a.zip |
emailer: use instance name instead of hostname
Diffstat (limited to 'server/lib/emailer.ts')
-rw-r--r-- | server/lib/emailer.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index e4e093fbc..5243a6029 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts | |||
@@ -472,7 +472,7 @@ class Emailer { | |||
472 | const emailPayload: EmailPayload = { | 472 | const emailPayload: EmailPayload = { |
473 | template: 'user-registered', | 473 | template: 'user-registered', |
474 | to, | 474 | to, |
475 | subject: `a new user registered on ${WEBSERVER.HOST}: ${user.username}`, | 475 | subject: `a new user registered on ${CONFIG.INSTANCE.NAME}: ${user.username}`, |
476 | locals: { | 476 | locals: { |
477 | user | 477 | user |
478 | } | 478 | } |
@@ -486,7 +486,7 @@ class Emailer { | |||
486 | const videoUrl = WEBSERVER.URL + videoBlacklist.Video.getWatchStaticPath() | 486 | const videoUrl = WEBSERVER.URL + videoBlacklist.Video.getWatchStaticPath() |
487 | 487 | ||
488 | const reasonString = videoBlacklist.reason ? ` for the following reason: ${videoBlacklist.reason}` : '' | 488 | const reasonString = videoBlacklist.reason ? ` for the following reason: ${videoBlacklist.reason}` : '' |
489 | const blockedString = `Your video ${videoName} (${videoUrl} on ${WEBSERVER.HOST} has been blacklisted${reasonString}.` | 489 | const blockedString = `Your video ${videoName} (${videoUrl} on ${CONFIG.INSTANCE.NAME} has been blacklisted${reasonString}.` |
490 | 490 | ||
491 | const emailPayload: EmailPayload = { | 491 | const emailPayload: EmailPayload = { |
492 | to, | 492 | to, |
@@ -506,7 +506,7 @@ class Emailer { | |||
506 | const emailPayload: EmailPayload = { | 506 | const emailPayload: EmailPayload = { |
507 | to, | 507 | to, |
508 | subject: `Video ${video.name} unblacklisted`, | 508 | subject: `Video ${video.name} unblacklisted`, |
509 | text: `Your video "${video.name}" (${videoUrl}) on ${WEBSERVER.HOST} has been unblacklisted.`, | 509 | text: `Your video "${video.name}" (${videoUrl}) on ${CONFIG.INSTANCE.NAME} has been unblacklisted.`, |
510 | locals: { | 510 | locals: { |
511 | title: 'Your video was unblacklisted' | 511 | title: 'Your video was unblacklisted' |
512 | } | 512 | } |
@@ -547,7 +547,7 @@ class Emailer { | |||
547 | const emailPayload: EmailPayload = { | 547 | const emailPayload: EmailPayload = { |
548 | template: 'verify-email', | 548 | template: 'verify-email', |
549 | to: [ to ], | 549 | to: [ to ], |
550 | subject: `Verify your email on ${WEBSERVER.HOST}`, | 550 | subject: `Verify your email on ${CONFIG.INSTANCE.NAME}`, |
551 | locals: { | 551 | locals: { |
552 | username, | 552 | username, |
553 | verifyEmailUrl | 553 | verifyEmailUrl |
@@ -565,7 +565,7 @@ class Emailer { | |||
565 | const emailPayload: EmailPayload = { | 565 | const emailPayload: EmailPayload = { |
566 | to: [ to ], | 566 | to: [ to ], |
567 | subject: 'Account ' + blockedWord, | 567 | subject: 'Account ' + blockedWord, |
568 | text: `Your account ${user.username} on ${WEBSERVER.HOST} has been ${blockedWord}${reasonString}.` | 568 | text: `Your account ${user.username} on ${CONFIG.INSTANCE.NAME} has been ${blockedWord}${reasonString}.` |
569 | } | 569 | } |
570 | 570 | ||
571 | return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload }) | 571 | return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload }) |
@@ -597,7 +597,7 @@ class Emailer { | |||
597 | 597 | ||
598 | const fromDisplayName = options.from | 598 | const fromDisplayName = options.from |
599 | ? options.from | 599 | ? options.from |
600 | : WEBSERVER.HOST | 600 | : CONFIG.INSTANCE.NAME |
601 | 601 | ||
602 | const email = new Email({ | 602 | const email = new Email({ |
603 | send: true, | 603 | send: true, |
@@ -625,6 +625,7 @@ class Emailer { | |||
625 | locals: { // default variables available in all templates | 625 | locals: { // default variables available in all templates |
626 | WEBSERVER, | 626 | WEBSERVER, |
627 | EMAIL: CONFIG.EMAIL, | 627 | EMAIL: CONFIG.EMAIL, |
628 | instanceName: CONFIG.INSTANCE.NAME, | ||
628 | text: options.text, | 629 | text: options.text, |
629 | subject: options.subject | 630 | subject: options.subject |
630 | } | 631 | } |