public NotificationDto getNotificationDto()

in src/main/java/com/epam/digital/data/platform/notification/service/EmailNotificationLoader.java [49:66]


  public NotificationDto getNotificationDto(File dir) throws IOException {
    log.info("Processing email template {}", dir.getName());
    var indexFile = Path.of(dir.getPath(), TEMPLATE_CONTENT_FILE_NAME).toFile();
    var htmlString = FileUtils.readFileToString(indexFile, StandardCharsets.UTF_8);
    var document = Jsoup.parse(htmlString);
    document.outputSettings().syntax(Document.OutputSettings.Syntax.xml);

    embedImagesToHtml(document, dir);
    embedStyleToHtml(document, dir);

    var templateMetadataFile = Path.of(dir.getPath(), TEMPLATE_METADATA_FILE_NAME).toFile();

    return NotificationDto.builder()
        .channel(EMAIL.getChannelName())
        .templateMetadataFile(templateMetadataFile)
        .content(document.toString())
        .build();
  }