use of io.kamax.mxisd.config.threepid.medium.EmailTemplateConfig in project mxisd by kamax-io.
the class BuiltInEmailGeneratorSupplier method apply.
@Override
public Optional<EmailGenerator> apply(EmailConfig emailConfig, Mxisd mxisd) {
if (!processed) {
if (StringUtils.equals(GenericEmailNotificationGenerator.ID, emailConfig.getGenerator())) {
EmailTemplateConfig cfg = Optional.ofNullable(emailConfig.getGenerators().get(GenericEmailNotificationGenerator.ID)).map(json -> GsonUtil.get().fromJson(json, EmailTemplateConfig.class)).orElseGet(EmailTemplateConfig::new);
obj = new GenericEmailNotificationGenerator(cfg, emailConfig, mxisd.getConfig().getMatrix(), mxisd.getConfig().getServer());
}
}
processed = true;
return Optional.ofNullable(obj);
}
Aggregations