mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Build and send email for rejected contributions.
This commit is contained in:
parent
d092bd0068
commit
0192a45346
26
backend/src/mailer/sendContributionRejectedEmail.ts
Normal file
26
backend/src/mailer/sendContributionRejectedEmail.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
import Decimal from 'decimal.js-light'
|
||||||
|
import { sendEMail } from './sendEMail'
|
||||||
|
import { contributionRejected } from './text/contributionRejected'
|
||||||
|
|
||||||
|
export const sendContributionRejectedEmail = (data: {
|
||||||
|
senderFirstName: string
|
||||||
|
senderLastName: string
|
||||||
|
recipientFirstName: string
|
||||||
|
recipientLastName: string
|
||||||
|
recipientEmail: string
|
||||||
|
contributionMemo: string
|
||||||
|
contributionAmount: Decimal
|
||||||
|
overviewURL: string
|
||||||
|
}): Promise<boolean> => {
|
||||||
|
logger.info(
|
||||||
|
`sendEmail(): to=${data.recipientFirstName} ${data.recipientLastName} <${data.recipientEmail}>,
|
||||||
|
subject=${contributionRejected.de.subject},
|
||||||
|
text=${contributionRejected.de.text(data)}`,
|
||||||
|
)
|
||||||
|
return sendEMail({
|
||||||
|
to: `${data.recipientFirstName} ${data.recipientLastName} <${data.recipientEmail}>`,
|
||||||
|
subject: contributionRejected.de.subject,
|
||||||
|
text: contributionRejected.de.text(data),
|
||||||
|
})
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user