use of com.axelor.apps.message.db.repo.EmailAddressRepository in project axelor-open-suite by axelor.
the class MailServiceMessageImpl method resolve.
@Override
public Model resolve(String email) {
final EmailAddressRepository addresses = Beans.get(EmailAddressRepository.class);
final EmailAddress address = addresses.all().filter("self.address = ?1", email).fetchOne();
if (address != null) {
return address;
}
return super.resolve(email);
}
use of com.axelor.apps.message.db.repo.EmailAddressRepository in project axelor-open-suite by axelor.
the class TemplateMessageServiceImpl method getEmailAddress.
protected EmailAddress getEmailAddress(String recipient) {
if (Strings.isNullOrEmpty(recipient)) {
return null;
}
EmailAddressRepository emailAddressRepo = Beans.get(EmailAddressRepository.class);
EmailAddress emailAddress = emailAddressRepo.findByAddress(recipient);
if (emailAddress == null) {
Map<String, Object> values = new HashMap<>();
values.put("address", recipient);
emailAddress = emailAddressRepo.create(values);
}
return emailAddress;
}
Aggregations