Browse Source
Merge pull request #10970 from thingsboard/fix/email-notification
Fix sysadmin notification being sent with tenant mail sender
pull/10974/head
Viacheslav Klimov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
2 additions and
2 deletions
-
application/src/main/java/org/thingsboard/server/service/notification/channels/EmailNotificationChannel.java
-
application/src/main/java/org/thingsboard/server/service/notification/channels/SmsNotificationChannel.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()) |
|
|
|
|
|
|
|
@ -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 |
|
|
|
|