Skip to content

Commit

Permalink
fix: Send email with userId. (#905)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Oct 18, 2024
1 parent 9940735 commit a67ad5f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/main/java/org/spin/grpc/service/SendNotifications.java
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,23 @@ private SendNotificationResponse.Builder sendNotification(SendNotificationReques

// Add Recipient to Notification
request.getRecipientsList().forEach(recipients -> {
int contactId = -1;
String accountName = null;
if (recipients.getContactId() > 0) {
MUser user = MUser.get(Env.getCtx(), recipients.getContactId());
if (user != null) {
contactId = user.getAD_User_ID();
if (!Util.isEmpty(user.getEMail(), true)) {
accountName = user.getEMail();
}
}
}
if (Util.isEmpty(accountName, true)) {
accountName = recipients.getAccountName();
}
notifier.addRecipient(
recipients.getContactId(),
recipients.getAccountName()
contactId,
accountName
);
});

Expand Down

0 comments on commit a67ad5f

Please sign in to comment.