X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Femailer.ts;h=edc99057ca9e76f69180e5429f3575f5f42b7b60;hb=371d4c60639e405ce8a503bea1395e9102fbba84;hp=6bb61484b2fe072375fa58a48f426d584f516036;hpb=421ff4618da64f0849353383f690a014024c40da;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index 6bb61484b..edc99057c 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts @@ -4,7 +4,8 @@ import { createTransport, Transporter } from 'nodemailer' import { join } from 'path' import { EmailPayload } from '@shared/models' import { SendEmailDefaultOptions } from '../../shared/models/server/emailer.model' -import { isTestInstance, root } from '../helpers/core-utils' +import { isTestInstance } from '../helpers/core-utils' +import { root } from '@shared/core-utils' import { bunyanLogger, logger } from '../helpers/logger' import { CONFIG, isEmailEnabled } from '../initializers/config' import { WEBSERVER } from '../initializers/constants' @@ -140,6 +141,12 @@ class Emailer { const email = new Email({ send: true, + htmlToText: { + selectors: [ + { selector: 'img', format: 'skip' }, + { selector: 'a', options: { hideLinkHrefIfSameAsText: true } } + ] + }, message: { from: `"${fromDisplayName}" <${CONFIG.SMTP.FROM_ADDRESS}>` }, @@ -172,7 +179,7 @@ class Emailer { } } - // overriden/new variables given for a specific template in the payload + // overridden/new variables given for a specific template in the payload const sendOptions = merge(baseOptions, options) await email.send(sendOptions) @@ -222,7 +229,7 @@ class Emailer { sendmail: true, newline: 'unix', path: CONFIG.SMTP.SENDMAIL, - logger: bunyanLogger as any + logger: bunyanLogger }) }