Skip to content

Commit

Permalink
Fix email link escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Sep 6, 2024
1 parent ab6b2b5 commit f9b46e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/tests/src/api/users/registrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ describe('Test registrations', function () {
await server.registrations.reject({ id: id4, moderationResponse: 'I do not want id 4 on this instance' })
})

it('Should have sent an email to the user explanining the registration has been rejected', async function () {
it('Should have sent an email to the user explaining the registration has been rejected', async function () {
this.timeout(50000)

await waitJobs([ server ])
Expand All @@ -220,7 +220,7 @@ describe('Test registrations', function () {
await server.registrations.accept({ id: id3, moderationResponse: 'Welcome id 3' })
})

it('Should have sent an email to the user explanining the registration has been accepted', async function () {
it('Should have sent an email to the user explaining the registration has been accepted', async function () {
this.timeout(50000)

await waitJobs([ server ])
Expand Down
3 changes: 2 additions & 1 deletion server/core/lib/emailer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { arrayify } from '@peertube/peertube-core-utils'
import { EmailPayload, SendEmailDefaultOptions, UserExportState, UserRegistrationState } from '@peertube/peertube-models'
import { isTestOrDevInstance, root } from '@peertube/peertube-node-utils'
import { UserModel } from '@server/models/user/user.js'
import { readFileSync } from 'fs'
import merge from 'lodash-es/merge.js'
import { Transporter, createTransport } from 'nodemailer'
Expand All @@ -10,7 +11,6 @@ import { CONFIG, isEmailEnabled } from '../initializers/config.js'
import { WEBSERVER } from '../initializers/constants.js'
import { MRegistration, MUser, MUserExport, MUserImport } from '../types/models/index.js'
import { JobQueue } from './job-queue/index.js'
import { UserModel } from '@server/models/user/user.js'

class Emailer {

Expand Down Expand Up @@ -253,6 +253,7 @@ class Emailer {

const email = new EmailTemplates({
send: true,
juice: false,
htmlToText: {
selectors: [
{ selector: 'img', format: 'skip' },
Expand Down

0 comments on commit f9b46e8

Please sign in to comment.