Class DigestMailBuilder

java.lang.Object
io.meeds.commons.digest.service.DigestMailBuilder

@Component public class DigestMailBuilder extends Object
Builds one digest email from the waiting items of one occurrence: keeps the categories the user selected for this frequency (the second half of the double check), groups them in display order, asks each addon for its lines, caps every category and counts the rest, then lays everything out with the template. Zero lines means no email at all.
  • Constructor Details

    • DigestMailBuilder

      public DigestMailBuilder(io.meeds.commons.digest.DigestCategoryRegistry categoryRegistry, DigestLabelResolver labelResolver, DigestRecipientResolver recipientResolver, DigestMailRenderer renderer, @Value("${exo.notification.digest.daily.cap:5}") int dailyCap, @Value("${exo.notification.digest.weekly.cap:10}") int weeklyCap)
  • Method Details

    • build

      public org.exoplatform.commons.api.notification.model.MessageInfo build(DigestUserEntity user, io.meeds.commons.digest.model.DigestFrequency frequency, io.meeds.commons.digest.model.DigestUserSettings settings, List<DigestItemEntity> items, Instant from, Instant until)
      Parameters:
      user - the recipient row of the work list
      frequency - the digest being sent
      settings - his current choices, the category list of the frequency is applied here
      items - the waiting items of the occurrence, most recent first
      from - the previous watermark, start of the covered period
      until - the claim moment, end of the covered period
      Returns:
      the email ready for the queue, or null when nothing is left to say