use of org.dbflute.mail.send.supplement.filter.SMailSubjectFilter in project fess by codelibs.
the class FessMailDeliveryDepartmentCreator method createDogmaticPostalPersonnel.
protected SMailDogmaticPostalPersonnel createDogmaticPostalPersonnel() {
// #ext_point e.g. locale, database
final String testPrefix = fessConfig.getMailSubjectTestPrefix();
final AsyncManager asyncManager = getAsyncManager();
final MessageManager messageManager = getMessageManager();
return new SMailDogmaticPostalPersonnel() {
// *if you need user locale switching or templates from database,
// override createConventionReceptionist() (see the method for the details)
@Override
protected SMailConventionReceptionist createConventionReceptionist() {
return super.createConventionReceptionist().asReceiverLocale(postcard -> {
return OptionalThing.empty();
});
}
@Override
protected OptionalThing<SMailSubjectFilter> createSubjectFilter() {
return OptionalThing.of((view, subject) -> testPrefix + subject);
}
@Override
protected OptionalThing<SMailAsyncStrategy> createAsyncStrategy() {
return OptionalThing.of((view, runnable) -> async(asyncManager, runnable));
}
@Override
protected OptionalThing<SMailLabelStrategy> createLabelStrategy() {
return OptionalThing.of((view, locale, label) -> resolveLabelIfNeeds(messageManager, locale, label));
}
};
}
Aggregations