/** * Retrieves the contact email for a tenant. If the tenant is null ("global tenant"), then use the global site * settings * * @param tenant the tenant for which to get the contact email, or null for a global tenant * @return the found contact email or null if no contact email has been found */ private String getTenantContactEmail(Tenant tenant) { if (tenant == null) { return siteSettings.getContactEmail(); } else { return StringUtils.isNotBlank(tenant.getContactEmail()) ? tenant.getContactEmail() : generalSettings.getNotificationsEmail(); } }
@Override public Mail emailToTenant() { return new Mail().from(generalSettings.getNotificationsEmail()).to(context.getTenant().getContactEmail()); }