Fix getNotificationRequestPreview

This commit is contained in:
ViacheslavKlimov 2023-04-13 18:41:28 +03:00
parent 7b6f3ed4df
commit d2912af543

View File

@ -251,9 +251,12 @@ public class NotificationController extends BaseController {
preview.setRecipientsCountByTarget(recipientsCountByTarget); preview.setRecipientsCountByTarget(recipientsCountByTarget);
preview.setTotalRecipientsCount(recipientsCountByTarget.values().stream().mapToInt(Integer::intValue).sum()); preview.setTotalRecipientsCount(recipientsCountByTarget.values().stream().mapToInt(Integer::intValue).sum());
Set<NotificationDeliveryMethod> deliveryMethods = template.getConfiguration().getDeliveryMethodsTemplates().entrySet()
.stream().filter(entry -> entry.getValue().isEnabled()).map(Map.Entry::getKey).collect(Collectors.toSet());
NotificationProcessingContext ctx = NotificationProcessingContext.builder() NotificationProcessingContext ctx = NotificationProcessingContext.builder()
.tenantId(user.getTenantId()) .tenantId(user.getTenantId())
.request(request) .request(request)
.deliveryMethods(deliveryMethods)
.template(template) .template(template)
.settings(null) .settings(null)
.build(); .build();