SonarSource/sonarqube · error

Email template not found for notification: {}

Error message

Email template not found for notification: {}

What it means

Warning (not an exception) logged in EmailNotificationChannel.format when none of the registered EmailTemplate instances recognizes the given Notification and returns an EmailMessage. It means the notification channel has been asked to deliver a notification type it has no template for, so no email is sent and null is returned upstream; the notification's type/key is printed in the {} placeholder.

Source

Thrown at server/sonar-server-common/src/main/java/org/sonar/server/notification/email/EmailNotificationChannel.java:205

      .count();
  }

  @CheckForNull
  private User findByLogin(String login) {
    try (DbSession dbSession = dbClient.openSession(false)) {
      UserDto dto = dbClient.userDao().selectActiveUserByLogin(dbSession, login);
      return dto != null ? dto.toUser() : null;
    }
  }

  private EmailMessage format(Notification notification) {
    for (EmailTemplate template : templates) {
      EmailMessage email = template.format(notification);
      if (email != null) {
        return email;
      }
    }
    LOG.warn("Email template not found for notification: {}", notification);
    return null;
  }

  boolean deliver(EmailMessage emailMessage) {
    if (!isActivated()) {
      LOG.debug(SMTP_HOST_NOT_CONFIGURED_DEBUG_MSG);
      return false;
    }
    try {
      send(emailMessage);
      return true;
    } catch (EmailException e) {
      LOG.error("Unable to send email", e);
      return false;
    }
  }

  private void send(EmailMessage emailMessage) throws EmailException {

View on GitHub (pinned to 184c821202)

Solutions

  1. Register an EmailTemplate that handles the notification type reported in the warning, or verify the plugin providing it is installed and enabled
  2. Check that the notification subtype triggering this event is one supported by the email channel (see EmailNotificationChannel's supported template list)
  3. If the notification is intentionally unsupported, disable that notification subscription for the affected users to stop the warnings
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at server/sonar-server-common/src/main/java/org/sonar/server/notification/email/EmailNotificationChannel.java:205 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of SonarSource/sonarqube@184c821202 (2026-09-09). Data as JSON: /api/errors/0da038038aca6eca. Report an issue: GitHub.