mirror of
https://github.com/IT4Change/gradido.git
synced 2026-04-27 15:09:01 +00:00
only send TX-Receive-Email after disbursement if recipient.email exists
This commit is contained in:
parent
6b558c9256
commit
3f648bcadc
@ -674,6 +674,11 @@ export class TransactionLinkResolver {
|
|||||||
methodLogger.error(errmsg)
|
methodLogger.error(errmsg)
|
||||||
throw new LogError(errmsg)
|
throw new LogError(errmsg)
|
||||||
}
|
}
|
||||||
|
if(recipientUser.emailContact?.email !== null){
|
||||||
|
if (methodLogger.isDebugEnabled()) {
|
||||||
|
methodLogger.debug('Sending Transaction Received Email to recipient:', recipientUser.firstName, recipientUser.lastName)
|
||||||
|
}
|
||||||
|
try {
|
||||||
await sendTransactionReceivedEmail({
|
await sendTransactionReceivedEmail({
|
||||||
firstName: recipientFirstName,
|
firstName: recipientFirstName,
|
||||||
lastName: recipientUser.lastName,
|
lastName: recipientUser.lastName,
|
||||||
@ -685,7 +690,16 @@ export class TransactionLinkResolver {
|
|||||||
senderEmail: senderUser.emailContact.email,
|
senderEmail: senderUser.emailContact.email,
|
||||||
transactionAmount: new Decimal(amount),
|
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) {
|
} catch (e) {
|
||||||
const errmsg = `Disburse JWT was not sent successfully with error=${e}`
|
const errmsg = `Disburse JWT was not sent successfully with error=${e}`
|
||||||
methodLogger.error(errmsg)
|
methodLogger.error(errmsg)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user