Skip to content

Commit

Permalink
Fallback to email template in Default tenant if it is not fiound in the
Browse files Browse the repository at this point in the history
current one
  • Loading branch information
car031 committed Nov 26, 2024
1 parent c767403 commit 6210e73
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import com.logicaldoc.core.folder.FolderDAO;
import com.logicaldoc.core.metadata.Attribute;
import com.logicaldoc.core.metadata.TemplateDAO;
import com.logicaldoc.core.security.Tenant;
import com.logicaldoc.core.security.TenantDAO;
import com.logicaldoc.core.security.user.UserDAO;
import com.logicaldoc.core.threading.ThreadPools;
Expand Down Expand Up @@ -266,6 +267,8 @@ public void send(EMail email, String templateName, Map<String, Object> dictionar
try {
template = templateDao.findByNameAndLanguage(templateName, email.getLocale().toString(),
email.getTenantId());
if (template == null)
templateDao.findByNameAndLanguage(templateName, email.getLocale().toString(), Tenant.DEFAULT_ID);
} catch (PersistenceException e) {
log.error(e.getMessage(), e);
}
Expand Down Expand Up @@ -310,7 +313,7 @@ public void send(EMail email) throws MessagingException {
log.error("Aspect sendingMessages not enabled");
return;
}

cleanAuthorAddress(email);

Session session = newMailSession();
Expand Down

0 comments on commit 6210e73

Please sign in to comment.