Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix login URL in email

Chocobozzz258efc247cfd
diff --git a/packages/models/src/server/emailer.model.ts b/packages/models/src/server/emailer.model.ts
index c7108c524c..1541d060ae 100644
--- a/packages/models/src/server/emailer.model.ts
+++ b/packages/models/src/server/emailer.model.ts
@@ -15,15 +15,17 @@ interface MailTemplate extends Base {
text?: undefined
}
+export interface MailAction {
+ url: string
+ text: string
+}
+
interface MailText extends Base {
text: string
locals?: Partial<SendEmailDefaultLocalsOptions> & {
title?: string
- action?: {
- url: string
- text: string
- }
+ action?: MailAction
}
}
diff --git a/server/core/lib/emailer.ts b/server/core/lib/emailer.ts
index 6bdebcfa57..c4cf5ba3b2 100644
--- a/server/core/lib/emailer.ts
+++ b/server/core/lib/emailer.ts
@@ -1,5 +1,5 @@
import { arrayify } from '@peertube/peertube-core-utils'
-import { EmailPayload, SendEmailDefaultOptions, To, UserExportState, UserRegistrationState } from '@peertube/peertube-models'
+import { EmailPayload, MailAction, SendEmailDefaultOptions, To, UserExportState, UserRegistrationState } from '@peertube/peertube-models'
import { getFilenameWithoutExt, isTestOrDevInstance, root } from '@peertube/peertube-node-utils'
import { t } from '@server/helpers/i18n.js'
import { toSafeMailHtml } from '@server/helpers/markdown.js'
@@ -229,13 +229,13 @@ export class Emailer {
let template: string
let subject: string
- let action: { text: string, href: string }
+ let action: MailAction
if (registration.state === UserRegistrationState.ACCEPTED) {
template = 'user-registration-request-accepted'
subject = t('Your registration request for {username} has been accepted', language, { username: registration.username })
- action = { text: t('Login to your account', language), href: loginUrl }
+ action = { text: t('Login to your account', language), url: loginUrl }
} else {
template = 'user-registration-request-rejected'
subject = t('Your registration request for {username} has been rejected', language, { username: registration.username })