]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
emailer: use instance name instead of hostname
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>
Thu, 10 Dec 2020 23:10:37 +0000 (00:10 +0100)
committerChocobozzz <chocobozzz@cpy.re>
Mon, 14 Dec 2020 14:37:29 +0000 (15:37 +0100)
server/lib/emailer.ts
server/lib/emails/abuse-new-message/html.pug
server/lib/emails/abuse-state-change/html.pug
server/lib/emails/account-abuse-new/html.pug
server/lib/emails/common/base.pug
server/lib/emails/contact-form/html.pug
server/lib/emails/password-create/html.pug
server/lib/emails/password-reset/html.pug
server/lib/emails/verify-email/html.pug
server/lib/emails/video-abuse-new/html.pug
server/lib/emails/video-comment-abuse-new/html.pug

index e4e093fbc57a547e317cdd9990e0fb6ae92c110f..5243a6029cfcf2699be5e5d00b24d13f7d39288d 100644 (file)
@@ -472,7 +472,7 @@ class Emailer {
     const emailPayload: EmailPayload = {
       template: 'user-registered',
       to,
-      subject: `a new user registered on ${WEBSERVER.HOST}: ${user.username}`,
+      subject: `a new user registered on ${CONFIG.INSTANCE.NAME}: ${user.username}`,
       locals: {
         user
       }
@@ -486,7 +486,7 @@ class Emailer {
     const videoUrl = WEBSERVER.URL + videoBlacklist.Video.getWatchStaticPath()
 
     const reasonString = videoBlacklist.reason ? ` for the following reason: ${videoBlacklist.reason}` : ''
-    const blockedString = `Your video ${videoName} (${videoUrl} on ${WEBSERVER.HOST} has been blacklisted${reasonString}.`
+    const blockedString = `Your video ${videoName} (${videoUrl} on ${CONFIG.INSTANCE.NAME} has been blacklisted${reasonString}.`
 
     const emailPayload: EmailPayload = {
       to,
@@ -506,7 +506,7 @@ class Emailer {
     const emailPayload: EmailPayload = {
       to,
       subject: `Video ${video.name} unblacklisted`,
-      text: `Your video "${video.name}" (${videoUrl}) on ${WEBSERVER.HOST} has been unblacklisted.`,
+      text: `Your video "${video.name}" (${videoUrl}) on ${CONFIG.INSTANCE.NAME} has been unblacklisted.`,
       locals: {
         title: 'Your video was unblacklisted'
       }
@@ -547,7 +547,7 @@ class Emailer {
     const emailPayload: EmailPayload = {
       template: 'verify-email',
       to: [ to ],
-      subject: `Verify your email on ${WEBSERVER.HOST}`,
+      subject: `Verify your email on ${CONFIG.INSTANCE.NAME}`,
       locals: {
         username,
         verifyEmailUrl
@@ -565,7 +565,7 @@ class Emailer {
     const emailPayload: EmailPayload = {
       to: [ to ],
       subject: 'Account ' + blockedWord,
-      text: `Your account ${user.username} on ${WEBSERVER.HOST} has been ${blockedWord}${reasonString}.`
+      text: `Your account ${user.username} on ${CONFIG.INSTANCE.NAME} has been ${blockedWord}${reasonString}.`
     }
 
     return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload })
@@ -597,7 +597,7 @@ class Emailer {
 
     const fromDisplayName = options.from
       ? options.from
-      : WEBSERVER.HOST
+      : CONFIG.INSTANCE.NAME
 
     const email = new Email({
       send: true,
@@ -625,6 +625,7 @@ class Emailer {
             locals: { // default variables available in all templates
               WEBSERVER,
               EMAIL: CONFIG.EMAIL,
+              instanceName: CONFIG.INSTANCE.NAME,
               text: options.text,
               subject: options.subject
             }
index 0841775d2479f1212dab11883b45ae50f4174baf..c1d452e7d3a3d582bae2603917f19e65026abf1a 100644 (file)
@@ -6,6 +6,6 @@ block title
 
 block content
   p
-    | A new message by #{messageAccountName} was posted on #[a(href=abuseUrl) abuse report ##{abuseId}] on #{WEBSERVER.HOST}
+    | A new message by #{messageAccountName} was posted on #[a(href=abuseUrl) abuse report ##{abuseId}] on #{instanceName}
   blockquote #{messageText}
   br(style="display: none;")
index ca89a2f054074d78ecf3e45f299039addf6f96cb..bb243e729924c386c3ba6bc09d7c08ccf0544515 100644 (file)
@@ -6,4 +6,4 @@ block title
 
 block content
   p
-    | #[a(href=abuseUrl) Your abuse report ##{abuseId}] on #{WEBSERVER.HOST} has been #{isAccepted ? 'accepted' : 'rejected'}
+    | #[a(href=abuseUrl) Your abuse report ##{abuseId}] on #{instanceName} has been #{isAccepted ? 'accepted' : 'rejected'}
index f1aa2886e6b735be3fc8e19b5abe24888873a238..e4c0366fb0372b6176a59b6efb17211c78e13070 100644 (file)
@@ -6,7 +6,7 @@ block title
 
 block content
   p
-    | #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}] received an abuse report for the #{isLocal ? '' : 'remote '}account
+    | #[a(href=WEBSERVER.URL) #{instanceName}] received an abuse report for the #{isLocal ? '' : 'remote '}account
     a(href=accountUrl)  #{accountDisplayName}
 
   p The reporter, #{reporter}, cited the following reason(s):
index 991cd5fbe68f4c9263834745aa0694d7e7be3604..6da5648e482553a3051b4be9683c28f0c4769d1e 100644 (file)
@@ -230,7 +230,7 @@ body(width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule:
                 tr
                   td(style='padding: 20px; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555;')
                     p(style='margin: 0;')
-                      | You are receiving this email as part of your notification settings on #{WEBSERVER.HOST} for your account #{username}.
+                      | You are receiving this email as part of your notification settings on #{instanceName} for your account #{username}.
         //- 1 Column Text : END
       //- Email Body : END
       //- Email Footer : BEGIN
index 0073ff78e27091951665e9173e99974135dad8cd..5a24fa6f118abd247a80dda7009a29dce569a0d8 100644 (file)
@@ -4,6 +4,6 @@ block title
   | Someone just used the contact form
 
 block content
-  p #{fromName} sent you a message via the contact form on #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}]:
+  p #{fromName} sent you a message via the contact form on #[a(href=WEBSERVER.URL) #{instanceName}]:
   blockquote(style='white-space: pre-wrap') #{body}
   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
index 45ff3078a23774f17843fd9ea648e51e5619a759..2061435fc0d08fe157a95e22ff697601edcf328c 100644 (file)
@@ -5,6 +5,6 @@ block title
 
 block content
   p.
-    Welcome to #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}], your PeerTube instance. Your username is: #{username}.
+    Welcome to #[a(href=WEBSERVER.URL) #{instanceName}], your PeerTube instance. Your username is: #{username}.
     Please set your password by following #[a(href=createPasswordUrl) this link]: #[a(href=createPasswordUrl) #{createPasswordUrl}] 
     (this link will expire within seven days).
\ No newline at end of file
index ac33db5d79edc83468dacf17884c572ae47a6693..54a3ee6df59f014acb622802167b839a3498a908 100644 (file)
@@ -5,7 +5,7 @@ block title
 
 block content
   p.
-    A reset password procedure for your account #{username} has been requested on #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}].
+    A reset password procedure for your account #{username} has been requested on #[a(href=WEBSERVER.URL) #{instanceName}].
     Please follow #[a(href=resetPasswordUrl) this link] to reset it: #[a(href=resetPasswordUrl) #{resetPasswordUrl}]
     (the link will expire within 1 hour)
   p.
index 8a4a777032177290555e20e3bf50e7b967f9679d..e6d805a163e1521a813c892fd9361e364bf30146 100644 (file)
@@ -6,9 +6,9 @@ block title
 block content
   p Welcome to PeerTube!
   p.
-    You just created an account #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}], your new PeerTube instance. 
+    You just created an account #[a(href=WEBSERVER.URL) #{instanceName}], your new PeerTube instance. 
     Your username there is: #{username}.
   p.
-    To start using PeerTube on #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}] you must verify your email first! 
+    To start using PeerTube on #[a(href=WEBSERVER.URL) #{instanceName}] you must verify your email first! 
     Please follow #[a(href=verifyEmailUrl) this link] to verify this email belongs to you: #[a(href=verifyEmailUrl) #{verifyEmailUrl}] 
     If you are not the person who initiated this request, please ignore this email.
\ No newline at end of file
index a1acdabdccdacdb569743897dc1c55513ae2eac0..a085b4b383747a1f838b62855f23dc6e4ffeb0af 100644 (file)
@@ -6,7 +6,7 @@ block title
 
 block content
   p
-    | #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}] received an abuse report for the #{isLocal ? '' : 'remote '}video "
+    | #[a(href=WEBSERVER.URL) #{instanceName}] received an abuse report for the #{isLocal ? '' : 'remote '}video "
     a(href=videoUrl) #{videoName}
     | " by #[+channel(videoChannel)]
     if videoPublishedAt
index e92d986b5df01d1365089e6f7d333645d800b78e..752bf7c104cf8bebe8f6fc2d41cbf0ca39d43605 100644 (file)
@@ -6,7 +6,7 @@ block title
 
 block content
   p
-    | #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}] received an abuse report for the #{isLocal ? '' : 'remote '}
+    | #[a(href=WEBSERVER.URL) #{instanceName}] received an abuse report for the #{isLocal ? '' : 'remote '}
     a(href=commentUrl) comment on video "#{videoName}"
     |  of #{flaggedAccount}
     |  created on #{commentCreatedAt}