Implement sender name and amount in subject of email 'transactionReceived'

This commit is contained in:
Wolfgang Huß 2022-12-20 15:36:47 +01:00
parent 9b4c8fe610
commit cd6a6df123
5 changed files with 11 additions and 9 deletions

View File

@ -642,17 +642,19 @@ describe('sendEmailVariants', () => {
to: 'Peter Lustig <peter@lustig.de>', to: 'Peter Lustig <peter@lustig.de>',
from: 'Gradido (do not answer) <info@gradido.net>', from: 'Gradido (do not answer) <info@gradido.net>',
attachments: [], attachments: [],
subject: 'Gradido: You have received Gradidos', subject: 'Gradido: Bibi Bloxberg has sent you 37.40 Gradidos',
html: expect.any(String), html: expect.any(String),
text: expect.stringContaining('GRADIDO: YOU HAVE RECEIVED GRADIDOS'), text: expect.stringContaining('GRADIDO: BIBI BLOXBERG HAS SENT YOU 37.40 GRADIDOS'),
}), }),
}) })
expect(result.originalMessage.html).toContain('<!DOCTYPE html>') expect(result.originalMessage.html).toContain('<!DOCTYPE html>')
expect(result.originalMessage.html).toContain('<html lang="en">') expect(result.originalMessage.html).toContain('<html lang="en">')
expect(result.originalMessage.html).toContain( expect(result.originalMessage.html).toContain(
'<title>Gradido: You have received Gradidos</title>', '<title>Gradido: Bibi Bloxberg has sent you 37.40 Gradidos</title>',
)
expect(result.originalMessage.html).toContain(
'>Gradido: Bibi Bloxberg has sent you 37.40 Gradidos</h1>',
) )
expect(result.originalMessage.html).toContain('>Gradido: You have received Gradidos</h1>')
expect(result.originalMessage.html).toContain('Hello Peter Lustig') expect(result.originalMessage.html).toContain('Hello Peter Lustig')
expect(result.originalMessage.html).toContain( expect(result.originalMessage.html).toContain(
'You have just received 37.40 GDD from Bibi Bloxberg (bibi@bloxberg.de).', 'You have just received 37.40 GDD from Bibi Bloxberg (bibi@bloxberg.de).',

View File

@ -1,9 +1,9 @@
doctype html doctype html
html(lang=locale) html(lang=locale)
head head
title= t('emails.transactionReceived.subject') title= t('emails.transactionReceived.subject', { senderFirstName, senderLastName, transactionAmount })
body body
h1(style='margin-bottom: 24px;')= t('emails.transactionReceived.subject') h1(style='margin-bottom: 24px;')= t('emails.transactionReceived.subject', { senderFirstName, senderLastName, transactionAmount })
#container.col #container.col
include ../hello.pug include ../hello.pug
p= t('emails.transactionReceived.haveReceivedAmountGDDFrom', { transactionAmount, senderFirstName, senderLastName, senderEmail }) p= t('emails.transactionReceived.haveReceivedAmountGDDFrom', { transactionAmount, senderFirstName, senderLastName, senderEmail })

View File

@ -1 +1 @@
= t('emails.transactionReceived.subject') = t('emails.transactionReceived.subject', { senderFirstName, senderLastName, transactionAmount })

View File

@ -52,7 +52,7 @@
}, },
"transactionReceived": { "transactionReceived": {
"haveReceivedAmountGDDFrom": "du hast soeben {transactionAmount} GDD von {senderFirstName} {senderLastName} ({senderEmail}) erhalten.", "haveReceivedAmountGDDFrom": "du hast soeben {transactionAmount} GDD von {senderFirstName} {senderLastName} ({senderEmail}) erhalten.",
"subject": "Gradido: Du hast Gradidos erhalten" "subject": "Gradido: {senderFirstName} {senderLastName} hat dir {transactionAmount} Gradidos gesendet"
} }
}, },
"general": { "general": {

View File

@ -52,7 +52,7 @@
}, },
"transactionReceived": { "transactionReceived": {
"haveReceivedAmountGDDFrom": "You have just received {transactionAmount} GDD from {senderFirstName} {senderLastName} ({senderEmail}).", "haveReceivedAmountGDDFrom": "You have just received {transactionAmount} GDD from {senderFirstName} {senderLastName} ({senderEmail}).",
"subject": "Gradido: You have received Gradidos" "subject": "Gradido: {senderFirstName} {senderLastName} has sent you {transactionAmount} Gradidos"
} }
}, },
"general": { "general": {