protected void internalSendMessage(String email, MessageType messageType, String subject, String htmlContent) { if (!getIsNotificationsRegistered()) { registerNotifications(); } Map<String, String> request = new HashMap<>();; String kindId = (String) notifications.get(messageType).get("id"); request.put("kind_id", kindId); request.put("to", email); request.put("subject", subject); request.put("html", htmlContent); HttpEntity<Map<String, String>> requestEntity = new HttpEntity<>(request); notificationsTemplate.exchange(notificationsUrl + "/emails", HttpMethod.POST, requestEntity, Void.class); }