Browse Source

Fix sysadmin notification being sent with tenant mail sender

pull/10970/head
ViacheslavKlimov 2 years ago
parent
commit
796bab6aa9
  1. 2
      application/src/main/java/org/thingsboard/server/service/notification/channels/EmailNotificationChannel.java
  2. 2
      application/src/main/java/org/thingsboard/server/service/notification/channels/SmsNotificationChannel.java

2
application/src/main/java/org/thingsboard/server/service/notification/channels/EmailNotificationChannel.java

@ -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())

2
application/src/main/java/org/thingsboard/server/service/notification/channels/SmsNotificationChannel.java

@ -38,7 +38,7 @@ public class SmsNotificationChannel implements NotificationChannel<User, SmsDeli
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

Loading…
Cancel
Save