Search in sources :

Example 1 with InboundEmailRejectionSender

use of com.google.gerrit.server.mail.send.InboundEmailRejectionSender in project gerrit by GerritCodeReview.

the class MailProcessor method sendRejectionEmail.

private void sendRejectionEmail(MailMessage message, InboundEmailError reason) {
    try {
        InboundEmailRejectionSender emailSender = emailRejectionSender.create(message.from(), message.id(), reason);
        emailSender.setMessageId(messageIdGenerator.fromMailMessage(message));
        emailSender.send();
    } catch (Exception e) {
        logger.atSevere().withCause(e).log("Cannot send email to warn for an error");
    }
}
Also used : InboundEmailRejectionSender(com.google.gerrit.server.mail.send.InboundEmailRejectionSender) UpdateException(com.google.gerrit.server.update.UpdateException) UnprocessableEntityException(com.google.gerrit.extensions.restapi.UnprocessableEntityException) RestApiException(com.google.gerrit.extensions.restapi.RestApiException) StorageException(com.google.gerrit.exceptions.StorageException) IOException(java.io.IOException)

Aggregations

StorageException (com.google.gerrit.exceptions.StorageException)1 RestApiException (com.google.gerrit.extensions.restapi.RestApiException)1 UnprocessableEntityException (com.google.gerrit.extensions.restapi.UnprocessableEntityException)1 InboundEmailRejectionSender (com.google.gerrit.server.mail.send.InboundEmailRejectionSender)1 UpdateException (com.google.gerrit.server.update.UpdateException)1 IOException (java.io.IOException)1