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)
|
methodLogger.error(errmsg)
|
||||||
throw new LogError(errmsg)
|
throw new LogError(errmsg)
|
||||||
}
|
}
|
||||||
await sendTransactionReceivedEmail({
|
if(recipientUser.emailContact?.email !== null){
|
||||||
firstName: recipientFirstName,
|
if (methodLogger.isDebugEnabled()) {
|
||||||
lastName: recipientUser.lastName,
|
methodLogger.debug('Sending Transaction Received Email to recipient:', recipientUser.firstName, recipientUser.lastName)
|
||||||
email: recipientUser.emailContact.email,
|
}
|
||||||
language: recipientUser.language,
|
try {
|
||||||
memo,
|
await sendTransactionReceivedEmail({
|
||||||
senderFirstName: senderUser.firstName,
|
firstName: recipientFirstName,
|
||||||
senderLastName: senderUser.lastName,
|
lastName: recipientUser.lastName,
|
||||||
senderEmail: senderUser.emailContact.email,
|
email: recipientUser.emailContact.email,
|
||||||
transactionAmount: new Decimal(amount),
|
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) {
|
} 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