Search in sources :

Example 1 with MailTemplateAssociation

use of com.axelor.apps.base.db.MailTemplateAssociation in project axelor-open-suite by axelor.

the class MailServiceBaseImpl method getTemplateByModel.

protected Template getTemplateByModel(Model entity) {
    Class<?> klass = EntityHelper.getEntityClass(entity);
    List<MailTemplateAssociation> mailTemplateAssociationList = Beans.get(AppBaseService.class).getAppBase().getMailTemplateAssociationList();
    if (mailTemplateAssociationList != null) {
        for (MailTemplateAssociation item : mailTemplateAssociationList) {
            if (item.getModel().getFullName().equals(klass.getName())) {
                return item.getEmailTemplate();
            }
        }
    }
    return null;
}
Also used : MailTemplateAssociation(com.axelor.apps.base.db.MailTemplateAssociation)

Aggregations

MailTemplateAssociation (com.axelor.apps.base.db.MailTemplateAssociation)1