diff options
-rw-r--r-- | server/lib/emailer.ts | 6 | ||||
-rw-r--r-- | server/tests/api/server/contact-form.ts | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index ebad43650..fe5668881 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts | |||
@@ -141,6 +141,12 @@ class Emailer { | |||
141 | 141 | ||
142 | const email = new Email({ | 142 | const email = new Email({ |
143 | send: true, | 143 | send: true, |
144 | htmlToText: { | ||
145 | selectors: [ | ||
146 | { selector: 'img', format: 'skip' }, | ||
147 | { selector: 'a', options: { ignoreHref: true } } | ||
148 | ] | ||
149 | }, | ||
144 | message: { | 150 | message: { |
145 | from: `"${fromDisplayName}" <${CONFIG.SMTP.FROM_ADDRESS}>` | 151 | from: `"${fromDisplayName}" <${CONFIG.SMTP.FROM_ADDRESS}>` |
146 | }, | 152 | }, |
diff --git a/server/tests/api/server/contact-form.ts b/server/tests/api/server/contact-form.ts index f3facb04a..4f01f6fd5 100644 --- a/server/tests/api/server/contact-form.ts +++ b/server/tests/api/server/contact-form.ts | |||
@@ -61,6 +61,13 @@ describe('Test contact form', function () { | |||
61 | expect(email['text']).contains('my super message') | 61 | expect(email['text']).contains('my super message') |
62 | }) | 62 | }) |
63 | 63 | ||
64 | it('Should not have duplicated email adress in text message', async function () { | ||
65 | const text = emails[0]['text'] as string | ||
66 | |||
67 | const matches = text.match(/toto@example.com/g) | ||
68 | expect(matches).to.have.lengthOf(1) | ||
69 | }) | ||
70 | |||
64 | it('Should not be able to send another contact form because of the anti spam checker', async function () { | 71 | it('Should not be able to send another contact form because of the anti spam checker', async function () { |
65 | this.timeout(10000) | 72 | this.timeout(10000) |
66 | 73 | ||