mirror of
https://github.com/IT4Change/gradido.git
synced 2026-03-01 12:44:43 +00:00
only send TX-Receive-Email after disbursement if recipient.email exists
This commit is contained in:
parent
6b558c9256
commit
3f648bcadc
@ -674,18 +674,32 @@ export class TransactionLinkResolver {
|
||||
methodLogger.error(errmsg)
|
||||
throw new LogError(errmsg)
|
||||
}
|
||||
await sendTransactionReceivedEmail({
|
||||
firstName: recipientFirstName,
|
||||
lastName: recipientUser.lastName,
|
||||
email: recipientUser.emailContact.email,
|
||||
language: recipientUser.language,
|
||||
memo,
|
||||
senderFirstName: senderUser.firstName,
|
||||
senderLastName: senderUser.lastName,
|
||||
senderEmail: senderUser.emailContact.email,
|
||||
transactionAmount: new Decimal(amount),
|
||||
})
|
||||
|
||||
if(recipientUser.emailContact?.email !== null){
|
||||
if (methodLogger.isDebugEnabled()) {
|
||||
methodLogger.debug('Sending Transaction Received Email to recipient:', recipientUser.firstName, recipientUser.lastName)
|
||||
}
|
||||
try {
|
||||
await sendTransactionReceivedEmail({
|
||||
firstName: recipientFirstName,
|
||||
lastName: recipientUser.lastName,
|
||||
email: recipientUser.emailContact.email,
|
||||
language: recipientUser.language,
|
||||
memo,
|
||||
senderFirstName: senderUser.firstName,
|
||||
senderLastName: senderUser.lastName,
|
||||
senderEmail: senderUser.emailContact.email,
|
||||
transactionAmount: new Decimal(amount),
|
||||
})
|
||||
} catch (e) {
|
||||
const errmsg = `Send Transaction Received Email to recipient failed with error=${e}`
|
||||
methodLogger.error(errmsg)
|
||||
throw new Error(errmsg)
|
||||
}
|
||||
} else {
|
||||
if (methodLogger.isDebugEnabled()) {
|
||||
methodLogger.debug('Recipient as foreign user has no email contact, not sending Transaction Received Email to recipient:', recipientUser.firstName, recipientUser.lastName)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
const errmsg = `Disburse JWT was not sent successfully with error=${e}`
|
||||
methodLogger.error(errmsg)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user