Fix email links displayed twice as text
This commit is contained in:
parent
ec2fa0d0b1
commit
3c7ddd7daa
|
@ -141,6 +141,12 @@ class Emailer {
|
||||||
|
|
||||||
const email = new Email({
|
const email = new Email({
|
||||||
send: true,
|
send: true,
|
||||||
|
htmlToText: {
|
||||||
|
selectors: [
|
||||||
|
{ selector: 'img', format: 'skip' },
|
||||||
|
{ selector: 'a', options: { ignoreHref: true } }
|
||||||
|
]
|
||||||
|
},
|
||||||
message: {
|
message: {
|
||||||
from: `"${fromDisplayName}" <${CONFIG.SMTP.FROM_ADDRESS}>`
|
from: `"${fromDisplayName}" <${CONFIG.SMTP.FROM_ADDRESS}>`
|
||||||
},
|
},
|
||||||
|
|
|
@ -61,6 +61,13 @@ describe('Test contact form', function () {
|
||||||
expect(email['text']).contains('my super message')
|
expect(email['text']).contains('my super message')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('Should not have duplicated email adress in text message', async function () {
|
||||||
|
const text = emails[0]['text'] as string
|
||||||
|
|
||||||
|
const matches = text.match(/toto@example.com/g)
|
||||||
|
expect(matches).to.have.lengthOf(1)
|
||||||
|
})
|
||||||
|
|
||||||
it('Should not be able to send another contact form because of the anti spam checker', async function () {
|
it('Should not be able to send another contact form because of the anti spam checker', async function () {
|
||||||
this.timeout(10000)
|
this.timeout(10000)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue