aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2020-12-11 00:10:37 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-12-14 15:37:29 +0100
commit2e4b8ae4858616572deec6ebdaa38f20ae96be7a (patch)
tree18032a014a0b5e90548c6083d440f4e9f4f44338 /server
parent915e2bbb97a85b53b4d7b7e2f2d9a416c891a0fb (diff)
downloadPeerTube-2e4b8ae4858616572deec6ebdaa38f20ae96be7a.tar.gz
PeerTube-2e4b8ae4858616572deec6ebdaa38f20ae96be7a.tar.zst
PeerTube-2e4b8ae4858616572deec6ebdaa38f20ae96be7a.zip
emailer: use instance name instead of hostname
Diffstat (limited to 'server')
-rw-r--r--server/lib/emailer.ts13
-rw-r--r--server/lib/emails/abuse-new-message/html.pug2
-rw-r--r--server/lib/emails/abuse-state-change/html.pug2
-rw-r--r--server/lib/emails/account-abuse-new/html.pug2
-rw-r--r--server/lib/emails/common/base.pug2
-rw-r--r--server/lib/emails/contact-form/html.pug2
-rw-r--r--server/lib/emails/password-create/html.pug2
-rw-r--r--server/lib/emails/password-reset/html.pug2
-rw-r--r--server/lib/emails/verify-email/html.pug4
-rw-r--r--server/lib/emails/video-abuse-new/html.pug2
-rw-r--r--server/lib/emails/video-comment-abuse-new/html.pug2
11 files changed, 18 insertions, 17 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 }
diff --git a/server/lib/emails/abuse-new-message/html.pug b/server/lib/emails/abuse-new-message/html.pug
index 0841775d2..c1d452e7d 100644
--- a/server/lib/emails/abuse-new-message/html.pug
+++ b/server/lib/emails/abuse-new-message/html.pug
@@ -6,6 +6,6 @@ block title
6 6
7block content 7block content
8 p 8 p
9 | A new message by #{messageAccountName} was posted on #[a(href=abuseUrl) abuse report ##{abuseId}] on #{WEBSERVER.HOST} 9 | A new message by #{messageAccountName} was posted on #[a(href=abuseUrl) abuse report ##{abuseId}] on #{instanceName}
10 blockquote #{messageText} 10 blockquote #{messageText}
11 br(style="display: none;") 11 br(style="display: none;")
diff --git a/server/lib/emails/abuse-state-change/html.pug b/server/lib/emails/abuse-state-change/html.pug
index ca89a2f05..bb243e729 100644
--- a/server/lib/emails/abuse-state-change/html.pug
+++ b/server/lib/emails/abuse-state-change/html.pug
@@ -6,4 +6,4 @@ block title
6 6
7block content 7block content
8 p 8 p
9 | #[a(href=abuseUrl) Your abuse report ##{abuseId}] on #{WEBSERVER.HOST} has been #{isAccepted ? 'accepted' : 'rejected'} 9 | #[a(href=abuseUrl) Your abuse report ##{abuseId}] on #{instanceName} has been #{isAccepted ? 'accepted' : 'rejected'}
diff --git a/server/lib/emails/account-abuse-new/html.pug b/server/lib/emails/account-abuse-new/html.pug
index f1aa2886e..e4c0366fb 100644
--- a/server/lib/emails/account-abuse-new/html.pug
+++ b/server/lib/emails/account-abuse-new/html.pug
@@ -6,7 +6,7 @@ block title
6 6
7block content 7block content
8 p 8 p
9 | #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}] received an abuse report for the #{isLocal ? '' : 'remote '}account 9 | #[a(href=WEBSERVER.URL) #{instanceName}] received an abuse report for the #{isLocal ? '' : 'remote '}account
10 a(href=accountUrl) #{accountDisplayName} 10 a(href=accountUrl) #{accountDisplayName}
11 11
12 p The reporter, #{reporter}, cited the following reason(s): 12 p The reporter, #{reporter}, cited the following reason(s):
diff --git a/server/lib/emails/common/base.pug b/server/lib/emails/common/base.pug
index 991cd5fbe..6da5648e4 100644
--- a/server/lib/emails/common/base.pug
+++ b/server/lib/emails/common/base.pug
@@ -230,7 +230,7 @@ body(width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule:
230 tr 230 tr
231 td(style='padding: 20px; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555;') 231 td(style='padding: 20px; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555;')
232 p(style='margin: 0;') 232 p(style='margin: 0;')
233 | You are receiving this email as part of your notification settings on #{WEBSERVER.HOST} for your account #{username}. 233 | You are receiving this email as part of your notification settings on #{instanceName} for your account #{username}.
234 //- 1 Column Text : END 234 //- 1 Column Text : END
235 //- Email Body : END 235 //- Email Body : END
236 //- Email Footer : BEGIN 236 //- Email Footer : BEGIN
diff --git a/server/lib/emails/contact-form/html.pug b/server/lib/emails/contact-form/html.pug
index 0073ff78e..5a24fa6f1 100644
--- a/server/lib/emails/contact-form/html.pug
+++ b/server/lib/emails/contact-form/html.pug
@@ -4,6 +4,6 @@ block title
4 | Someone just used the contact form 4 | Someone just used the contact form
5 5
6block content 6block content
7 p #{fromName} sent you a message via the contact form on #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}]: 7 p #{fromName} sent you a message via the contact form on #[a(href=WEBSERVER.URL) #{instanceName}]:
8 blockquote(style='white-space: pre-wrap') #{body} 8 blockquote(style='white-space: pre-wrap') #{body}
9 p You can contact them at #[a(href=`mailto:${fromEmail}`) #{fromEmail}], or simply reply to this email to get in touch. \ No newline at end of file 9 p You can contact them at #[a(href=`mailto:${fromEmail}`) #{fromEmail}], or simply reply to this email to get in touch. \ No newline at end of file
diff --git a/server/lib/emails/password-create/html.pug b/server/lib/emails/password-create/html.pug
index 45ff3078a..2061435fc 100644
--- a/server/lib/emails/password-create/html.pug
+++ b/server/lib/emails/password-create/html.pug
@@ -5,6 +5,6 @@ block title
5 5
6block content 6block content
7 p. 7 p.
8 Welcome to #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}], your PeerTube instance. Your username is: #{username}. 8 Welcome to #[a(href=WEBSERVER.URL) #{instanceName}], your PeerTube instance. Your username is: #{username}.
9 Please set your password by following #[a(href=createPasswordUrl) this link]: #[a(href=createPasswordUrl) #{createPasswordUrl}] 9 Please set your password by following #[a(href=createPasswordUrl) this link]: #[a(href=createPasswordUrl) #{createPasswordUrl}]
10 (this link will expire within seven days). \ No newline at end of file 10 (this link will expire within seven days). \ No newline at end of file
diff --git a/server/lib/emails/password-reset/html.pug b/server/lib/emails/password-reset/html.pug
index ac33db5d7..54a3ee6df 100644
--- a/server/lib/emails/password-reset/html.pug
+++ b/server/lib/emails/password-reset/html.pug
@@ -5,7 +5,7 @@ block title
5 5
6block content 6block content
7 p. 7 p.
8 A reset password procedure for your account #{username} has been requested on #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}]. 8 A reset password procedure for your account #{username} has been requested on #[a(href=WEBSERVER.URL) #{instanceName}].
9 Please follow #[a(href=resetPasswordUrl) this link] to reset it: #[a(href=resetPasswordUrl) #{resetPasswordUrl}] 9 Please follow #[a(href=resetPasswordUrl) this link] to reset it: #[a(href=resetPasswordUrl) #{resetPasswordUrl}]
10 (the link will expire within 1 hour) 10 (the link will expire within 1 hour)
11 p. 11 p.
diff --git a/server/lib/emails/verify-email/html.pug b/server/lib/emails/verify-email/html.pug
index 8a4a77703..e6d805a16 100644
--- a/server/lib/emails/verify-email/html.pug
+++ b/server/lib/emails/verify-email/html.pug
@@ -6,9 +6,9 @@ block title
6block content 6block content
7 p Welcome to PeerTube! 7 p Welcome to PeerTube!
8 p. 8 p.
9 You just created an account #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}], your new PeerTube instance. 9 You just created an account #[a(href=WEBSERVER.URL) #{instanceName}], your new PeerTube instance.
10 Your username there is: #{username}. 10 Your username there is: #{username}.
11 p. 11 p.
12 To start using PeerTube on #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}] you must verify your email first! 12 To start using PeerTube on #[a(href=WEBSERVER.URL) #{instanceName}] you must verify your email first!
13 Please follow #[a(href=verifyEmailUrl) this link] to verify this email belongs to you: #[a(href=verifyEmailUrl) #{verifyEmailUrl}] 13 Please follow #[a(href=verifyEmailUrl) this link] to verify this email belongs to you: #[a(href=verifyEmailUrl) #{verifyEmailUrl}]
14 If you are not the person who initiated this request, please ignore this email. \ No newline at end of file 14 If you are not the person who initiated this request, please ignore this email. \ No newline at end of file
diff --git a/server/lib/emails/video-abuse-new/html.pug b/server/lib/emails/video-abuse-new/html.pug
index a1acdabdc..a085b4b38 100644
--- a/server/lib/emails/video-abuse-new/html.pug
+++ b/server/lib/emails/video-abuse-new/html.pug
@@ -6,7 +6,7 @@ block title
6 6
7block content 7block content
8 p 8 p
9 | #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}] received an abuse report for the #{isLocal ? '' : 'remote '}video " 9 | #[a(href=WEBSERVER.URL) #{instanceName}] received an abuse report for the #{isLocal ? '' : 'remote '}video "
10 a(href=videoUrl) #{videoName} 10 a(href=videoUrl) #{videoName}
11 | " by #[+channel(videoChannel)] 11 | " by #[+channel(videoChannel)]
12 if videoPublishedAt 12 if videoPublishedAt
diff --git a/server/lib/emails/video-comment-abuse-new/html.pug b/server/lib/emails/video-comment-abuse-new/html.pug
index e92d986b5..752bf7c10 100644
--- a/server/lib/emails/video-comment-abuse-new/html.pug
+++ b/server/lib/emails/video-comment-abuse-new/html.pug
@@ -6,7 +6,7 @@ block title
6 6
7block content 7block content
8 p 8 p
9 | #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}] received an abuse report for the #{isLocal ? '' : 'remote '} 9 | #[a(href=WEBSERVER.URL) #{instanceName}] received an abuse report for the #{isLocal ? '' : 'remote '}
10 a(href=commentUrl) comment on video "#{videoName}" 10 a(href=commentUrl) comment on video "#{videoName}"
11 | of #{flaggedAccount} 11 | of #{flaggedAccount}
12 | created on #{commentCreatedAt} 12 | created on #{commentCreatedAt}