Search in sources :

Example 1 with MailAccount

use of com.axelor.mail.MailAccount in project axelor-open-suite by axelor.

the class MailServiceMessageImpl method getMailReader.

private MailReader getMailReader(EmailAccount emailAccount) {
    if (readerAccount == null || !readerAccount.getId().equals(emailAccount.getId()) || !readerAccount.getVersion().equals(emailAccount.getVersion())) {
        readerAccount = emailAccount;
        reader = null;
    }
    if (reader == null) {
        MailAccount mailAccount = mailAccountService.getMailAccount(emailAccount);
        reader = new MailReader(mailAccount);
    }
    return reader;
}
Also used : MailReader(com.axelor.mail.MailReader) MailAccount(com.axelor.mail.MailAccount)

Example 2 with MailAccount

use of com.axelor.mail.MailAccount in project axelor-open-suite by axelor.

the class MailServiceMessageImpl method getMailSender.

protected MailSender getMailSender(EmailAccount emailAccount) {
    if (senderAccount == null || !senderAccount.getId().equals(emailAccount.getId()) || !senderAccount.getVersion().equals(emailAccount.getVersion())) {
        senderAccount = emailAccount;
        sender = null;
    }
    if (sender == null) {
        MailAccount mailAccount = mailAccountService.getMailAccount(emailAccount);
        sender = new MailSender(mailAccount);
    }
    return sender;
}
Also used : MailSender(com.axelor.mail.MailSender) MailAccount(com.axelor.mail.MailAccount)

Aggregations

MailAccount (com.axelor.mail.MailAccount)2 MailReader (com.axelor.mail.MailReader)1 MailSender (com.axelor.mail.MailSender)1