private void readEmailNotificationTemplatesFromFile() {
        Path file = config.getConfigDirectory().resolve("notifications/email/notification-template-index.json");
        if (Files.notExists(file)) {
            LOGGER.warn("No email notification templates found at {0}", file);
            return;
        }
        try {
            // So pithy!
            Map<String, ReasonMap> localeTplMap = JsonUtil.toPojo(Files.readString(file), String.class, ReasonMap.class, HashMap.class);
            LOGGER.debug("Email notification templates read from {0}", file.toAbsolutePath());

            supportedLocales = localeTplMap.keySet().stream()
                    .map(Locale::forLanguageTag)
                    .collect(Collectors.toSet());

            localeTplMap.forEach((k, v) -> processReasonMap(file, k, v));
        } catch (IOException ioe) {
            throw new UncheckedIOException(ioe);
        }
    }
Find an email template for a provided reason (longest prefix match wins).

@param reasonKey the reason to find a template for
@param locale the locale to resolve
@return template, if a suitable one is found, otherwise empty
manager/api/rest-impl/src/main/java/io/apiman/manager/api/notifications/email/SimpleMailNotificationService.java