Source:
public void send(final EventAndOrganizationId event, final String fromName, final String to, final List<String> cc, final String subject, final String text, final Optional<String> html, final Attachment... attachment) { final var config = configurationManager.getFor(Set.of(ConfigurationKeys.SENDINBLUE_API_KEY, ConfigurationKeys.SENDINBLUE_FROM, ConfigurationKeys.MAIL_REPLY_TO), ConfigurationLevel.event(event)); final var from = config.get(ConfigurationKeys.SENDINBLUE_FROM).getRequiredValue(); final var payload = new HashMap<String, Object>(); if (ArrayUtils.isNotEmpty(attachment)) { addAttachments(payload, attachment); } payload.put("sender", Map.of("email", from, "name", fromName)); payload.put("to", Map.of("email",to)); payload.put("cc",createPersonalizations(cc)); payload.put("replyTo",config.get(ConfigurationKeys.MAIL_REPLY_TO).getRequiredValue()); payload.put("subject",subject); payload.put("templateId",config.get(ConfigurationKeys.SENDINBLUE_TEMPLATE_ID).getRequiredValue()); final var body = Json.GSON.toJson(payload); final var request = HttpRequest.newBuilder(URI.create("<LINK_0>")) .header(HttpUtils.API_KEY,config.get(ConfigurationKeys.SENDINBLUE_API_KEY).getRequiredValue()) .header(HttpUtils.CONTENT_TYPE, HttpUtils.APPLICATION_JSON) .POST(HttpRequest.BodyPublishers.ofString(body)).build(); try { HttpResponse<Void> response = client.send(request, HttpResponse.BodyHandlers.discarding()); if (!HttpUtils.callSuccessful(response)) { log.warn("sending email using sendinblue was not successful: ", response); throw new IllegalStateException("Attempt to send a message using sendinblue is failed. Result is: " + response.statusCode()); } } catch (IOException e) { log.warn("error while sending email using sendinblue", e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); log.warn("error while sending email using sendinblue", e); } }

Target:
public void send(final EventAndOrganizationId event, final String fromName, final String to, final List<String> cc, final String subject, final String text, final Optional<String> html, final Attachment... attachment) { final var config = configurationManager.getFor(Set.of(ConfigurationKeys.SENDINBLUE_API_KEY, ConfigurationKeys.SENDINBLUE_FROM, ConfigurationKeys.MAIL_REPLY_TO), ConfigurationLevel.event(event)); final var from = config.get(ConfigurationKeys.SENDINBLUE_FROM).getRequiredValue(); final var payload = new HashMap<String, Object>(); if (ArrayUtils.isNotEmpty(attachment)) { addAttachments(payload, attachment); } final var toList=new ArrayList<>(); toList.add(Map.of("email",to)); payload.put("sender", Map.of("email", from, "name", fromName)); payload.put("to", toList); payload.put("cc",createPersonalizations(cc)); payload.put("replyTo",config.get(ConfigurationKeys.MAIL_REPLY_TO).getRequiredValue()); payload.put("subject",subject); payload.put("htmlContent",html); payload.put("textContent",text); final var body = Json.GSON.toJson(payload); final var request = HttpRequest.newBuilder(URI.create("<LINK_0>")) .header(HttpUtils.API_KEY,config.get(ConfigurationKeys.SENDINBLUE_API_KEY).getRequiredValue()) .header(HttpUtils.CONTENT_TYPE, HttpUtils.APPLICATION_JSON) .POST(HttpRequest.BodyPublishers.ofString(body)).build(); try { HttpResponse<Void> response = client.send(request, HttpResponse.BodyHandlers.discarding()); if (!HttpUtils.callSuccessful(response)) { log.warn("sending email using sendinblue was not successful: ", response); throw new IllegalStateException("Attempt to send a message using sendinblue is failed. Result is: " + response.statusCode()); } } catch (IOException e) { log.warn("error while sending email using sendinblue", e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); log.warn("error while sending email using sendinblue", e); } }