Skip to content

Commit

Permalink
Merge pull request thingsboard#10970 from thingsboard/fix/email-notif…
Browse files Browse the repository at this point in the history
…ication

Fix sysadmin notification being sent with tenant mail sender
  • Loading branch information
ViacheslavKlimov authored Jun 12, 2024
2 parents 3d1e133 + 796bab6 commit ea00ab9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class EmailNotificationChannel implements NotificationChannel<User, Email

@Override
public void sendNotification(User recipient, EmailDeliveryMethodNotificationTemplate processedTemplate, NotificationProcessingContext ctx) throws Exception {
mailService.send(recipient.getTenantId(), null, TbEmail.builder()
mailService.send(ctx.getTenantId(), null, TbEmail.builder()
.to(recipient.getEmail())
.subject(processedTemplate.getSubject())
.body(processedTemplate.getBody())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void sendNotification(User recipient, SmsDeliveryMethodNotificationTempla
throw new RuntimeException("User does not have phone number");
}

smsService.sendSms(recipient.getTenantId(), recipient.getCustomerId(), new String[]{phone}, processedTemplate.getBody());
smsService.sendSms(ctx.getTenantId(), null, new String[]{phone}, processedTemplate.getBody());
}

@Override
Expand Down

0 comments on commit ea00ab9

Please sign in to comment.