Package io.meeds.commons.digest.service
Class DigestMailBuilder
java.lang.Object
io.meeds.commons.digest.service.DigestMailBuilder
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 Summary
ConstructorsConstructorDescriptionDigestMailBuilder(io.meeds.commons.digest.DigestCategoryRegistry categoryRegistry, DigestLabelResolver labelResolver, DigestRecipientResolver recipientResolver, DigestMailRenderer renderer, int dailyCap, int weeklyCap) -
Method Summary
Modifier and TypeMethodDescriptionorg.exoplatform.commons.api.notification.model.MessageInfobuild(DigestUserEntity user, io.meeds.commons.digest.model.DigestFrequency frequency, io.meeds.commons.digest.model.DigestUserSettings settings, List<DigestItemEntity> items, Instant from, Instant until)
-
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 listfrequency- the digest being sentsettings- his current choices, the category list of the frequency is applied hereitems- the waiting items of the occurrence, most recent firstfrom- the previous watermark, start of the covered perioduntil- the claim moment, end of the covered period- Returns:
- the email ready for the queue, or null when nothing is left to say
-