From bfb55aba239ade35b81d67ebd80f24cae16aed0a Mon Sep 17 00:00:00 2001 From: marijahorvat171 Date: Fri, 4 Apr 2025 10:08:14 +0200 Subject: [PATCH 1/4] 2040- brevo add trigger --- .../docs/reference/components/brevo.md | 29 +- .../brevo/BrevoComponentHandler.java | 3 + .../brevo/constant/BrevoConstants.java | 1 + .../BrevoTransactionalEmailOpenedTrigger.java | 73 + .../component/brevo/util/BrevoUtils.java | 23 + ...voTransactionalEmailOpenedTriggerTest.java | 99 ++ .../test/resources/definition/brevo_v1.json | 1255 +---------------- 7 files changed, 228 insertions(+), 1255 deletions(-) create mode 100644 server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTrigger.java create mode 100644 server/libs/modules/components/brevo/src/test/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTriggerTest.java diff --git a/docs/src/content/docs/reference/components/brevo.md b/docs/src/content/docs/reference/components/brevo.md index e2571fa965..52e39d6cbd 100644 --- a/docs/src/content/docs/reference/components/brevo.md +++ b/docs/src/content/docs/reference/components/brevo.md @@ -6,7 +6,7 @@ description: "Brevo is an email marketing platform that offers a cloud-based mar Brevo is an email marketing platform that offers a cloud-based marketing communication software suite with transactional email, marketing automation, customer-relationship management and more. -Categories: marketing-automation +Categories: Marketing Automation Type: brevo/v1 @@ -187,3 +187,30 @@ Type: OBJECT +## Triggers + + +### Transactional Email Opened +Name: transactionalEmailOpened + +Triggers when transactional email is opened. + +Type: DYNAMIC_WEBHOOK + + +#### Output + +The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action. + +#### JSON Example +```json +{ + "label" : "Transactional Email Opened", + "name" : "transactionalEmailOpened", + "type" : "brevo/v1/transactionalEmailOpened" +} +``` + + +
+ diff --git a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/BrevoComponentHandler.java b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/BrevoComponentHandler.java index 2272a5e76a..943c1b808b 100644 --- a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/BrevoComponentHandler.java +++ b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/BrevoComponentHandler.java @@ -24,6 +24,7 @@ import com.bytechef.component.brevo.action.BrevoSendTransactionalEmailAction; import com.bytechef.component.brevo.action.BrevoUpdateContactAction; import com.bytechef.component.brevo.connection.BrevoConnection; +import com.bytechef.component.brevo.trigger.BrevoTransactionalEmailOpenedTrigger; import com.bytechef.component.definition.ComponentCategory; import com.bytechef.component.definition.ComponentDefinition; import com.google.auto.service.AutoService; @@ -46,6 +47,8 @@ public class BrevoComponentHandler implements ComponentHandler { BrevoCreateContactAction.ACTION_DEFINITION, BrevoUpdateContactAction.ACTION_DEFINITION, BrevoSendTransactionalEmailAction.ACTION_DEFINITION) + .triggers( + BrevoTransactionalEmailOpenedTrigger.TRIGGER_DEFINITION) .clusterElements( tool(BrevoCreateContactAction.ACTION_DEFINITION), tool(BrevoUpdateContactAction.ACTION_DEFINITION), diff --git a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/constant/BrevoConstants.java b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/constant/BrevoConstants.java index e5b401f996..0565e74b86 100644 --- a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/constant/BrevoConstants.java +++ b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/constant/BrevoConstants.java @@ -27,6 +27,7 @@ public class BrevoConstants { public static final String CONTENT_TYPE = "contentType"; public static final String EMAIL = "email"; public static final String FIRST_NAME = "FIRSTNAME"; + public static final String ID = "id"; public static final String LAST_NAME = "LASTNAME"; public static final String NAME = "name"; public static final String RECIPIENT_EMAIL = "recipientEmail"; diff --git a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTrigger.java b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTrigger.java new file mode 100644 index 0000000000..b5722a3152 --- /dev/null +++ b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTrigger.java @@ -0,0 +1,73 @@ +/* + * Copyright 2023-present ByteChef Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.bytechef.component.brevo.trigger; + +import static com.bytechef.component.brevo.constant.BrevoConstants.ID; +import static com.bytechef.component.definition.ComponentDsl.trigger; + +import com.bytechef.component.brevo.util.BrevoUtils; +import com.bytechef.component.definition.ComponentDsl; +import com.bytechef.component.definition.Parameters; +import com.bytechef.component.definition.TriggerContext; +import com.bytechef.component.definition.TriggerDefinition; +import java.util.Map; + +/** + * @author Marija Horvat + */ +public class BrevoTransactionalEmailOpenedTrigger { + + public static final ComponentDsl.ModifiableTriggerDefinition TRIGGER_DEFINITION = + trigger("transactionalEmailOpened") + .title("Transactional Email Opened") + .description("Triggers when transactional email is opened.") + .type(TriggerDefinition.TriggerType.DYNAMIC_WEBHOOK) + .properties() + .output() + .webhookEnable(BrevoTransactionalEmailOpenedTrigger::webhookEnable) + .webhookDisable(BrevoTransactionalEmailOpenedTrigger::webhookDisable) + .webhookRequest(BrevoTransactionalEmailOpenedTrigger::webhookRequest); + + private BrevoTransactionalEmailOpenedTrigger() { + } + + protected static TriggerDefinition.WebhookEnableOutput webhookEnable( + Parameters inputParameters, Parameters connectionParameters, String webhookUrl, + String workflowExecutionId, TriggerContext context) { + + return new TriggerDefinition.WebhookEnableOutput( + Map.of(ID, + BrevoUtils.createWebhook(webhookUrl, context)), + null); + } + + protected static void webhookDisable( + Parameters inputParameters, Parameters connectionParameters, Parameters outputParameters, + String workflowExecutionId, TriggerContext context) { + + BrevoUtils.deleteWebhook(outputParameters, context); + } + + protected static Object webhookRequest( + Parameters inputParameters, Parameters connectionParameters, TriggerDefinition.HttpHeaders headers, + TriggerDefinition.HttpParameters parameters, + TriggerDefinition.WebhookBody body, TriggerDefinition.WebhookMethod method, + TriggerDefinition.WebhookEnableOutput output, TriggerContext context) { + + return body.getContent(); + } +} diff --git a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/util/BrevoUtils.java b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/util/BrevoUtils.java index d9ec01643b..b85b0a705d 100644 --- a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/util/BrevoUtils.java +++ b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/util/BrevoUtils.java @@ -17,6 +17,7 @@ package com.bytechef.component.brevo.util; import static com.bytechef.component.brevo.constant.BrevoConstants.EMAIL; +import static com.bytechef.component.brevo.constant.BrevoConstants.ID; import static com.bytechef.component.definition.ComponentDsl.option; import static com.bytechef.component.definition.Context.Http.responseType; @@ -24,6 +25,7 @@ import com.bytechef.component.definition.Context.Http; import com.bytechef.component.definition.Option; import com.bytechef.component.definition.Parameters; +import com.bytechef.component.definition.TriggerContext; import com.bytechef.component.definition.TypeReference; import java.util.ArrayList; import java.util.List; @@ -83,4 +85,25 @@ public static List> getSendersOptions( return options; } + public static String createWebhook( + String webhookUrl, TriggerContext context) { + + Map body = context.http(http -> http.post("/webhooks")) + .body(Context.Http.Body.of( + "url", webhookUrl, + "events", List.of("opened"))) + .configuration(Context.Http.responseType(Context.Http.ResponseType.JSON)) + .execute() + .getBody(new TypeReference<>() {}); + + return body.get(ID) + .toString(); + } + + public static void deleteWebhook(Parameters outputParameters, Context context) { + context.http(http -> http.delete("/webhooks/" + outputParameters.getString(ID))) + .configuration(Context.Http.responseType(Context.Http.ResponseType.JSON)) + .execute(); + } + } diff --git a/server/libs/modules/components/brevo/src/test/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTriggerTest.java b/server/libs/modules/components/brevo/src/test/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTriggerTest.java new file mode 100644 index 0000000000..2e0b373ade --- /dev/null +++ b/server/libs/modules/components/brevo/src/test/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTriggerTest.java @@ -0,0 +1,99 @@ +/* + * Copyright 2023-present ByteChef Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.bytechef.component.brevo.trigger; + +import static com.bytechef.component.brevo.constant.BrevoConstants.ID; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.mockStatic; +import static org.mockito.Mockito.when; + +import com.bytechef.component.brevo.util.BrevoUtils; +import com.bytechef.component.definition.Parameters; +import com.bytechef.component.definition.TriggerContext; +import com.bytechef.component.definition.TriggerDefinition; +import java.time.LocalDateTime; +import java.util.Map; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; + +/** + * @author Marija Horvat + */ +class BrevoTransactionalEmailOpenedTriggerTest { + + protected TriggerDefinition.WebhookEnableOutput mockedWebhookEnableOutput = + mock(TriggerDefinition.WebhookEnableOutput.class); + protected TriggerDefinition.WebhookBody mockedWebhookBody = mock(TriggerDefinition.WebhookBody.class); + protected TriggerDefinition.HttpHeaders mockedHttpHeaders = mock(TriggerDefinition.HttpHeaders.class); + protected TriggerDefinition.HttpParameters mockedHttpParameters = mock(TriggerDefinition.HttpParameters.class); + protected TriggerDefinition.WebhookMethod mockedWebhookMethod = mock(TriggerDefinition.WebhookMethod.class); + protected Parameters mockedParameters = mock(Parameters.class); + protected TriggerContext mockedTriggerContext = mock(TriggerContext.class); + protected MockedStatic brevoUtilsMockedStatic; + protected String workflowExecutionId = "testWorkflowExecutionId"; + private final Object mockedObject = mock(Object.class); + + @BeforeEach + public void beforeEach() { + brevoUtilsMockedStatic = mockStatic(BrevoUtils.class); + } + + @AfterEach + public void afterEach() { + brevoUtilsMockedStatic.close(); + } + + @Test + void testWebhookEnable() { + String webhookUrl = "testWebhookUrl"; + + when(mockedParameters.getRequiredString(ID)) + .thenReturn("id"); + + brevoUtilsMockedStatic.when( + () -> BrevoUtils.createWebhook(webhookUrl, mockedTriggerContext)) + .thenReturn("123"); + + TriggerDefinition.WebhookEnableOutput webhookEnableOutput = BrevoTransactionalEmailOpenedTrigger.webhookEnable( + mockedParameters, mockedParameters, webhookUrl, workflowExecutionId, mockedTriggerContext); + + Map parameters = webhookEnableOutput.parameters(); + LocalDateTime webhookExpirationDate = webhookEnableOutput.webhookExpirationDate(); + + Map expectedParameters = Map.of(ID, "123"); + + assertEquals(expectedParameters, parameters); + assertNull(webhookExpirationDate); + } + + @Test + void testWebhookRequest() { + + when(mockedWebhookBody.getContent()) + .thenReturn(mockedObject); + + Object result = BrevoTransactionalEmailOpenedTrigger.webhookRequest( + mockedParameters, mockedParameters, mockedHttpHeaders, mockedHttpParameters, mockedWebhookBody, + mockedWebhookMethod, mockedWebhookEnableOutput, mockedTriggerContext); + + assertEquals(mockedObject, result); + } +} diff --git a/server/libs/modules/components/brevo/src/test/resources/definition/brevo_v1.json b/server/libs/modules/components/brevo/src/test/resources/definition/brevo_v1.json index 8fe26970ea..5280027167 100644 --- a/server/libs/modules/components/brevo/src/test/resources/definition/brevo_v1.json +++ b/server/libs/modules/components/brevo/src/test/resources/definition/brevo_v1.json @@ -1,1254 +1 @@ -{ - "componentCategories" : [ { - "name" : "marketing-automation", - "label" : "Marketing Automation" - } ], - "customAction" : null, - "customActionHelp" : null, - "description" : "Brevo is an email marketing platform that offers a cloud-based marketing communication software suite with transactional email, marketing automation, customer-relationship management and more.", - "icon" : "path:assets/brevo.svg", - "tags" : null, - "metadata" : null, - "name" : "brevo", - "resources" : null, - "version" : 1, - "title" : "Brevo", - "connection" : { - "authorizations" : [ { - "detectOn" : null, - "description" : null, - "name" : "api_key", - "properties" : [ { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : true, - "metadata" : { }, - "required" : true, - "name" : "key", - "type" : "STRING", - "defaultValue" : "api-key", - "exampleValue" : null, - "label" : "Key", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "value", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "API key", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "refreshOn" : null, - "title" : "API Key", - "type" : "API_KEY", - "acquire" : null, - "authorizationUrl" : null, - "clientSecret" : null, - "refreshToken" : null, - "apply" : null, - "clientId" : null, - "pkce" : null, - "refresh" : null, - "refreshUrl" : null, - "scopes" : null, - "tokenUrl" : null, - "oauth2AuthorizationExtraQueryParameters" : null, - "authorizationCallback" : null - } ], - "properties" : null, - "version" : 1, - "authorizationRequired" : null, - "baseUri" : { }, - "test" : null - }, - "actions" : [ { - "batch" : null, - "deprecated" : null, - "description" : "Creates new contact.", - "help" : null, - "metadata" : null, - "name" : "createContact", - "outputDefinition" : { - "output" : null, - "outputResponse" : { - "outputSchema" : { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "OBJECT", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "additionalProperties" : null, - "multipleValues" : null, - "options" : null, - "properties" : [ { - "advancedOption" : null, - "description" : "ID of the created contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : "id", - "type" : "INTEGER", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "maxValue" : null, - "minValue" : null, - "options" : null, - "optionsDataSource" : null, - "controlType" : "INTEGER" - } ], - "optionsDataSource" : null, - "controlType" : "OBJECT_BUILDER" - }, - "sampleOutput" : null, - "placeholder" : null - }, - "outputSchema" : { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "OBJECT", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "additionalProperties" : null, - "multipleValues" : null, - "options" : null, - "properties" : [ { - "advancedOption" : null, - "description" : "ID of the created contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : "id", - "type" : "INTEGER", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "maxValue" : null, - "minValue" : null, - "options" : null, - "optionsDataSource" : null, - "controlType" : "INTEGER" - } ], - "optionsDataSource" : null, - "controlType" : "OBJECT_BUILDER" - }, - "sampleOutput" : null - }, - "properties" : [ { - "advancedOption" : null, - "description" : "Email address of the contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "email", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Email", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : "First name of the contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : false, - "name" : "FIRSTNAME", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "First Name", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : "Last name of the contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : false, - "name" : "LASTNAME", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Last Name", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "title" : "Create Contact", - "perform" : { }, - "processErrorResponse" : null, - "workflowNodeDescription" : null - }, { - "batch" : null, - "deprecated" : null, - "description" : "Updates existing contact.", - "help" : null, - "metadata" : null, - "name" : "updateContact", - "outputDefinition" : null, - "properties" : [ { - "advancedOption" : null, - "description" : "Email address of the contact to update.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "email", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Email", - "placeholder" : null, - "controlType" : "SELECT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : { - "optionsLookupDependsOn" : null, - "options" : { } - } - }, { - "advancedOption" : null, - "description" : "New first name of the contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : false, - "name" : "FIRSTNAME", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "First Name", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : "New last name of the contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : false, - "name" : "LASTNAME", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Last Name", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "title" : "Update Contact", - "perform" : { }, - "processErrorResponse" : null, - "workflowNodeDescription" : null - }, { - "batch" : null, - "deprecated" : null, - "description" : "Sends and email from your Brevo account.", - "help" : null, - "metadata" : null, - "name" : "sendTransactionalEmail", - "outputDefinition" : { - "output" : null, - "outputResponse" : { - "outputSchema" : { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "OBJECT", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "additionalProperties" : null, - "multipleValues" : null, - "options" : null, - "properties" : [ { - "advancedOption" : null, - "description" : "Message ID of the transactional email sent.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : "messageId", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "optionsDataSource" : null, - "controlType" : "OBJECT_BUILDER" - }, - "sampleOutput" : null, - "placeholder" : null - }, - "outputSchema" : { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "OBJECT", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "additionalProperties" : null, - "multipleValues" : null, - "options" : null, - "properties" : [ { - "advancedOption" : null, - "description" : "Message ID of the transactional email sent.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : "messageId", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "optionsDataSource" : null, - "controlType" : "OBJECT_BUILDER" - }, - "sampleOutput" : null - }, - "properties" : [ { - "advancedOption" : null, - "description" : "Email of the sender from which the emails will be sent.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "senderEmail", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Sender Email", - "placeholder" : null, - "controlType" : "SELECT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : { - "optionsLookupDependsOn" : null, - "options" : { } - } - }, { - "advancedOption" : null, - "description" : "The To: recipients for the message.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "to", - "type" : "ARRAY", - "defaultValue" : null, - "exampleValue" : null, - "label" : "To Recipients", - "placeholder" : null, - "items" : [ { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "controlType" : "EMAIL", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "maxItems" : null, - "minItems" : 1, - "multipleValues" : null, - "options" : null, - "optionsDataSource" : { - "optionsLookupDependsOn" : null, - "options" : { } - }, - "controlType" : "MULTI_SELECT" - }, { - "advancedOption" : null, - "description" : "The Bcc recipients for the message.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : false, - "name" : "bcc", - "type" : "ARRAY", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Bcc Recipients", - "placeholder" : null, - "items" : [ { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "controlType" : "EMAIL", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "maxItems" : null, - "minItems" : null, - "multipleValues" : null, - "options" : null, - "optionsDataSource" : { - "optionsLookupDependsOn" : null, - "options" : { } - }, - "controlType" : "MULTI_SELECT" - }, { - "advancedOption" : null, - "description" : "The Cc recipients for the message.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : false, - "name" : "cc", - "type" : "ARRAY", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Cc Recipients", - "placeholder" : null, - "items" : [ { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "controlType" : "EMAIL", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "maxItems" : null, - "minItems" : null, - "multipleValues" : null, - "options" : null, - "optionsDataSource" : { - "optionsLookupDependsOn" : null, - "options" : { } - }, - "controlType" : "MULTI_SELECT" - }, { - "advancedOption" : null, - "description" : "Subject of the email.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "subject", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Subject", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : "Content type of the email.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "contentType", - "type" : "STRING", - "defaultValue" : "TEXT", - "exampleValue" : null, - "label" : "Content Type", - "placeholder" : null, - "controlType" : "SELECT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : [ { - "description" : null, - "label" : "Text", - "value" : "TEXT" - }, { - "description" : null, - "label" : "HTML", - "value" : "HTML" - } ], - "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : "Plain text body of the message.", - "displayCondition" : "contentType == 'TEXT'", - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "content", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Text Content", - "placeholder" : null, - "controlType" : "TEXT_AREA", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : "HTML body of the message.", - "displayCondition" : "contentType == 'HTML'", - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "content", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "HTML Content", - "placeholder" : null, - "controlType" : "RICH_TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "title" : "Send Transactional Email", - "perform" : { }, - "processErrorResponse" : null, - "workflowNodeDescription" : null - } ], - "clusterElements" : [ { - "description" : "Creates new contact.", - "name" : "createContact", - "outputDefinition" : { - "output" : null, - "outputResponse" : { - "outputSchema" : { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "OBJECT", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "additionalProperties" : null, - "multipleValues" : null, - "options" : null, - "properties" : [ { - "advancedOption" : null, - "description" : "ID of the created contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : "id", - "type" : "INTEGER", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "maxValue" : null, - "minValue" : null, - "options" : null, - "optionsDataSource" : null, - "controlType" : "INTEGER" - } ], - "optionsDataSource" : null, - "controlType" : "OBJECT_BUILDER" - }, - "sampleOutput" : null, - "placeholder" : null - }, - "outputSchema" : { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "OBJECT", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "additionalProperties" : null, - "multipleValues" : null, - "options" : null, - "properties" : [ { - "advancedOption" : null, - "description" : "ID of the created contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : "id", - "type" : "INTEGER", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "maxValue" : null, - "minValue" : null, - "options" : null, - "optionsDataSource" : null, - "controlType" : "INTEGER" - } ], - "optionsDataSource" : null, - "controlType" : "OBJECT_BUILDER" - }, - "sampleOutput" : null - }, - "properties" : [ { - "advancedOption" : null, - "description" : "Email address of the contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "email", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Email", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : "First name of the contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : false, - "name" : "FIRSTNAME", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "First Name", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : "Last name of the contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : false, - "name" : "LASTNAME", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Last Name", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "title" : "Create Contact", - "type" : { - "name" : "TOOLS", - "key" : "tools", - "label" : "Tools", - "multipleElements" : true, - "required" : false - }, - "element" : { } - }, { - "description" : "Updates existing contact.", - "name" : "updateContact", - "outputDefinition" : null, - "properties" : [ { - "advancedOption" : null, - "description" : "Email address of the contact to update.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "email", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Email", - "placeholder" : null, - "controlType" : "SELECT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : { - "optionsLookupDependsOn" : null, - "options" : { } - } - }, { - "advancedOption" : null, - "description" : "New first name of the contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : false, - "name" : "FIRSTNAME", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "First Name", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : "New last name of the contact.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : false, - "name" : "LASTNAME", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Last Name", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "title" : "Update Contact", - "type" : { - "name" : "TOOLS", - "key" : "tools", - "label" : "Tools", - "multipleElements" : true, - "required" : false - }, - "element" : { } - }, { - "description" : "Sends and email from your Brevo account.", - "name" : "sendTransactionalEmail", - "outputDefinition" : { - "output" : null, - "outputResponse" : { - "outputSchema" : { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "OBJECT", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "additionalProperties" : null, - "multipleValues" : null, - "options" : null, - "properties" : [ { - "advancedOption" : null, - "description" : "Message ID of the transactional email sent.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : "messageId", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "optionsDataSource" : null, - "controlType" : "OBJECT_BUILDER" - }, - "sampleOutput" : null, - "placeholder" : null - }, - "outputSchema" : { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "OBJECT", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "additionalProperties" : null, - "multipleValues" : null, - "options" : null, - "properties" : [ { - "advancedOption" : null, - "description" : "Message ID of the transactional email sent.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : "messageId", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "optionsDataSource" : null, - "controlType" : "OBJECT_BUILDER" - }, - "sampleOutput" : null - }, - "properties" : [ { - "advancedOption" : null, - "description" : "Email of the sender from which the emails will be sent.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "senderEmail", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Sender Email", - "placeholder" : null, - "controlType" : "SELECT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : { - "optionsLookupDependsOn" : null, - "options" : { } - } - }, { - "advancedOption" : null, - "description" : "The To: recipients for the message.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "to", - "type" : "ARRAY", - "defaultValue" : null, - "exampleValue" : null, - "label" : "To Recipients", - "placeholder" : null, - "items" : [ { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "controlType" : "EMAIL", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "maxItems" : null, - "minItems" : 1, - "multipleValues" : null, - "options" : null, - "optionsDataSource" : { - "optionsLookupDependsOn" : null, - "options" : { } - }, - "controlType" : "MULTI_SELECT" - }, { - "advancedOption" : null, - "description" : "The Bcc recipients for the message.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : false, - "name" : "bcc", - "type" : "ARRAY", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Bcc Recipients", - "placeholder" : null, - "items" : [ { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "controlType" : "EMAIL", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "maxItems" : null, - "minItems" : null, - "multipleValues" : null, - "options" : null, - "optionsDataSource" : { - "optionsLookupDependsOn" : null, - "options" : { } - }, - "controlType" : "MULTI_SELECT" - }, { - "advancedOption" : null, - "description" : "The Cc recipients for the message.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : false, - "name" : "cc", - "type" : "ARRAY", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Cc Recipients", - "placeholder" : null, - "items" : [ { - "advancedOption" : null, - "description" : null, - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : null, - "name" : null, - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : null, - "placeholder" : null, - "controlType" : "EMAIL", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "maxItems" : null, - "minItems" : null, - "multipleValues" : null, - "options" : null, - "optionsDataSource" : { - "optionsLookupDependsOn" : null, - "options" : { } - }, - "controlType" : "MULTI_SELECT" - }, { - "advancedOption" : null, - "description" : "Subject of the email.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "subject", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Subject", - "placeholder" : null, - "controlType" : "TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : "Content type of the email.", - "displayCondition" : null, - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "contentType", - "type" : "STRING", - "defaultValue" : "TEXT", - "exampleValue" : null, - "label" : "Content Type", - "placeholder" : null, - "controlType" : "SELECT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : [ { - "description" : null, - "label" : "Text", - "value" : "TEXT" - }, { - "description" : null, - "label" : "HTML", - "value" : "HTML" - } ], - "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : "Plain text body of the message.", - "displayCondition" : "contentType == 'TEXT'", - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "content", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "Text Content", - "placeholder" : null, - "controlType" : "TEXT_AREA", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - }, { - "advancedOption" : null, - "description" : "HTML body of the message.", - "displayCondition" : "contentType == 'HTML'", - "expressionEnabled" : null, - "hidden" : null, - "metadata" : { }, - "required" : true, - "name" : "content", - "type" : "STRING", - "defaultValue" : null, - "exampleValue" : null, - "label" : "HTML Content", - "placeholder" : null, - "controlType" : "RICH_TEXT", - "languageId" : null, - "maxLength" : null, - "minLength" : null, - "options" : null, - "optionsDataSource" : null - } ], - "title" : "Send Transactional Email", - "type" : { - "name" : "TOOLS", - "key" : "tools", - "label" : "Tools", - "multipleElements" : true, - "required" : false - }, - "element" : { } - } ], - "unifiedApi" : null, - "triggers" : null -} \ No newline at end of file +{"componentCategories":[{"name":"marketing-automation","label":"Marketing Automation"}],"customAction":null,"customActionHelp":null,"description":"Brevo is an email marketing platform that offers a cloud-based marketing communication software suite with transactional email, marketing automation, customer-relationship management and more.","icon":"path:assets/brevo.svg","tags":null,"metadata":null,"name":"brevo","resources":null,"version":1,"title":"Brevo","actions":[{"batch":null,"deprecated":null,"description":"Creates new contact.","help":null,"metadata":null,"name":"createContact","outputDefinition":{"output":null,"outputResponse":{"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"ID of the created contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"id","type":"INTEGER","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"maxValue":null,"minValue":null,"options":null,"controlType":"INTEGER","optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null,"placeholder":null},"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"ID of the created contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"id","type":"INTEGER","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"maxValue":null,"minValue":null,"options":null,"controlType":"INTEGER","optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null},"properties":[{"advancedOption":null,"description":"Email address of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"email","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Email","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"First name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"FIRSTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"First Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"Last name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"LASTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Last Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"title":"Create Contact","processErrorResponse":null,"workflowNodeDescription":null,"perform":{}},{"batch":null,"deprecated":null,"description":"Updates existing contact.","help":null,"metadata":null,"name":"updateContact","outputDefinition":null,"properties":[{"advancedOption":null,"description":"Email address of the contact to update.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"email","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Email","placeholder":null,"controlType":"SELECT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"New first name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"FIRSTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"First Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"New last name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"LASTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Last Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"title":"Update Contact","processErrorResponse":null,"workflowNodeDescription":null,"perform":{}},{"batch":null,"deprecated":null,"description":"Sends and email from your Brevo account.","help":null,"metadata":null,"name":"sendTransactionalEmail","outputDefinition":{"output":null,"outputResponse":{"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"Message ID of the transactional email sent.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"messageId","type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null,"placeholder":null},"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"Message ID of the transactional email sent.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"messageId","type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null},"properties":[{"advancedOption":null,"description":"Email of the sender from which the emails will be sent.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"senderEmail","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Sender Email","placeholder":null,"controlType":"SELECT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"The To: recipients for the message.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"to","type":"ARRAY","defaultValue":null,"exampleValue":null,"label":"To Recipients","placeholder":null,"items":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"EMAIL","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"maxItems":null,"minItems":1,"multipleValues":null,"options":null,"controlType":"MULTI_SELECT","optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"The Bcc recipients for the message.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"bcc","type":"ARRAY","defaultValue":null,"exampleValue":null,"label":"Bcc Recipients","placeholder":null,"items":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"EMAIL","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"maxItems":null,"minItems":null,"multipleValues":null,"options":null,"controlType":"MULTI_SELECT","optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"The Cc recipients for the message.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"cc","type":"ARRAY","defaultValue":null,"exampleValue":null,"label":"Cc Recipients","placeholder":null,"items":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"EMAIL","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"maxItems":null,"minItems":null,"multipleValues":null,"options":null,"controlType":"MULTI_SELECT","optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"Subject of the email.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"subject","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Subject","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"Content type of the email.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"contentType","type":"STRING","defaultValue":"TEXT","exampleValue":null,"label":"Content Type","placeholder":null,"controlType":"SELECT","languageId":null,"maxLength":null,"minLength":null,"options":[{"description":null,"label":"Text","value":"TEXT"},{"description":null,"label":"HTML","value":"HTML"}],"optionsDataSource":null},{"advancedOption":null,"description":"Plain text body of the message.","displayCondition":"contentType == 'TEXT'","expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"content","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Text Content","placeholder":null,"controlType":"TEXT_AREA","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"HTML body of the message.","displayCondition":"contentType == 'HTML'","expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"content","type":"STRING","defaultValue":null,"exampleValue":null,"label":"HTML Content","placeholder":null,"controlType":"RICH_TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"title":"Send Transactional Email","processErrorResponse":null,"workflowNodeDescription":null,"perform":{}}],"clusterElements":[{"description":"Creates new contact.","name":"createContact","outputDefinition":{"output":null,"outputResponse":{"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"ID of the created contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"id","type":"INTEGER","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"maxValue":null,"minValue":null,"options":null,"controlType":"INTEGER","optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null,"placeholder":null},"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"ID of the created contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"id","type":"INTEGER","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"maxValue":null,"minValue":null,"options":null,"controlType":"INTEGER","optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null},"properties":[{"advancedOption":null,"description":"Email address of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"email","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Email","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"First name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"FIRSTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"First Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"Last name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"LASTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Last Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"title":"Create Contact","type":{"name":"TOOLS","key":"tools","label":"Tools","multipleElements":true,"required":false},"element":{}},{"description":"Updates existing contact.","name":"updateContact","outputDefinition":null,"properties":[{"advancedOption":null,"description":"Email address of the contact to update.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"email","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Email","placeholder":null,"controlType":"SELECT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"New first name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"FIRSTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"First Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"New last name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"LASTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Last Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"title":"Update Contact","type":{"name":"TOOLS","key":"tools","label":"Tools","multipleElements":true,"required":false},"element":{}},{"description":"Sends and email from your Brevo account.","name":"sendTransactionalEmail","outputDefinition":{"output":null,"outputResponse":{"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"Message ID of the transactional email sent.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"messageId","type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null,"placeholder":null},"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"Message ID of the transactional email sent.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"messageId","type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null},"properties":[{"advancedOption":null,"description":"Email of the sender from which the emails will be sent.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"senderEmail","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Sender Email","placeholder":null,"controlType":"SELECT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"The To: recipients for the message.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"to","type":"ARRAY","defaultValue":null,"exampleValue":null,"label":"To Recipients","placeholder":null,"items":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"EMAIL","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"maxItems":null,"minItems":1,"multipleValues":null,"options":null,"controlType":"MULTI_SELECT","optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"The Bcc recipients for the message.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"bcc","type":"ARRAY","defaultValue":null,"exampleValue":null,"label":"Bcc Recipients","placeholder":null,"items":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"EMAIL","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"maxItems":null,"minItems":null,"multipleValues":null,"options":null,"controlType":"MULTI_SELECT","optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"The Cc recipients for the message.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"cc","type":"ARRAY","defaultValue":null,"exampleValue":null,"label":"Cc Recipients","placeholder":null,"items":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"EMAIL","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"maxItems":null,"minItems":null,"multipleValues":null,"options":null,"controlType":"MULTI_SELECT","optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"Subject of the email.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"subject","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Subject","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"Content type of the email.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"contentType","type":"STRING","defaultValue":"TEXT","exampleValue":null,"label":"Content Type","placeholder":null,"controlType":"SELECT","languageId":null,"maxLength":null,"minLength":null,"options":[{"description":null,"label":"Text","value":"TEXT"},{"description":null,"label":"HTML","value":"HTML"}],"optionsDataSource":null},{"advancedOption":null,"description":"Plain text body of the message.","displayCondition":"contentType == 'TEXT'","expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"content","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Text Content","placeholder":null,"controlType":"TEXT_AREA","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"HTML body of the message.","displayCondition":"contentType == 'HTML'","expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"content","type":"STRING","defaultValue":null,"exampleValue":null,"label":"HTML Content","placeholder":null,"controlType":"RICH_TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"title":"Send Transactional Email","type":{"name":"TOOLS","key":"tools","label":"Tools","multipleElements":true,"required":false},"element":{}}],"unifiedApi":null,"triggers":[{"batch":null,"deprecated":null,"description":"Triggers when transactional email is opened.","help":null,"name":"transactionalEmailOpened","outputDefinition":{"output":null,"outputResponse":null,"outputSchema":null,"sampleOutput":null},"properties":[],"title":"Transactional Email Opened","type":"DYNAMIC_WEBHOOK","webhookRawBody":null,"workflowSyncExecution":null,"poll":null,"deduplicate":null,"webhookDisable":{},"webhookEnable":{},"dynamicWebhookRefresh":null,"processErrorResponse":null,"workflowNodeDescription":null,"webhookRequest":{},"listenerDisable":null,"listenerEnable":null,"webhookValidate":null,"webhookValidateOnEnable":null}],"connection":{"authorizations":[{"detectOn":null,"description":null,"name":"api_key","properties":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":true,"metadata":{},"required":true,"name":"key","type":"STRING","defaultValue":"api-key","exampleValue":null,"label":"Key","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"value","type":"STRING","defaultValue":null,"exampleValue":null,"label":"API key","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"refreshOn":null,"title":"API Key","type":"API_KEY","acquire":null,"refresh":null,"scopes":null,"apply":null,"pkce":null,"authorizationCallback":null,"authorizationUrl":null,"clientId":null,"clientSecret":null,"oauth2AuthorizationExtraQueryParameters":null,"refreshUrl":null,"refreshToken":null,"tokenUrl":null}],"properties":null,"version":1,"authorizationRequired":null,"baseUri":{},"test":null}} \ No newline at end of file From d5e594b1466725bd990ccafb1b0a7a38eeb6ed8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Monika=20Ku=C5=A1ter?= Date: Mon, 7 Apr 2025 13:12:53 +0200 Subject: [PATCH 2/4] 2040 - SF --- .../brevo/constant/BrevoConstants.java | 2 - .../BrevoTransactionalEmailOpenedTrigger.java | 55 +++++++----- .../component/brevo/util/BrevoUtils.java | 24 ------ ...voTransactionalEmailOpenedTriggerTest.java | 83 +++++++++---------- .../component/brevo/util/BrevoUtilsTest.java | 5 +- 5 files changed, 75 insertions(+), 94 deletions(-) diff --git a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/constant/BrevoConstants.java b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/constant/BrevoConstants.java index 0565e74b86..81897541e4 100644 --- a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/constant/BrevoConstants.java +++ b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/constant/BrevoConstants.java @@ -29,8 +29,6 @@ public class BrevoConstants { public static final String FIRST_NAME = "FIRSTNAME"; public static final String ID = "id"; public static final String LAST_NAME = "LASTNAME"; - public static final String NAME = "name"; - public static final String RECIPIENT_EMAIL = "recipientEmail"; public static final String SENDER_EMAIL = "senderEmail"; public static final String SUBJECT = "subject"; public static final String TO = "to"; diff --git a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTrigger.java b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTrigger.java index b5722a3152..e8194f13df 100644 --- a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTrigger.java +++ b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTrigger.java @@ -19,11 +19,18 @@ import static com.bytechef.component.brevo.constant.BrevoConstants.ID; import static com.bytechef.component.definition.ComponentDsl.trigger; -import com.bytechef.component.brevo.util.BrevoUtils; -import com.bytechef.component.definition.ComponentDsl; +import com.bytechef.component.definition.ComponentDsl.ModifiableTriggerDefinition; +import com.bytechef.component.definition.Context.Http; import com.bytechef.component.definition.Parameters; import com.bytechef.component.definition.TriggerContext; -import com.bytechef.component.definition.TriggerDefinition; +import com.bytechef.component.definition.TriggerDefinition.HttpHeaders; +import com.bytechef.component.definition.TriggerDefinition.HttpParameters; +import com.bytechef.component.definition.TriggerDefinition.TriggerType; +import com.bytechef.component.definition.TriggerDefinition.WebhookBody; +import com.bytechef.component.definition.TriggerDefinition.WebhookEnableOutput; +import com.bytechef.component.definition.TriggerDefinition.WebhookMethod; +import com.bytechef.component.definition.TypeReference; +import java.util.List; import java.util.Map; /** @@ -31,42 +38,44 @@ */ public class BrevoTransactionalEmailOpenedTrigger { - public static final ComponentDsl.ModifiableTriggerDefinition TRIGGER_DEFINITION = - trigger("transactionalEmailOpened") - .title("Transactional Email Opened") - .description("Triggers when transactional email is opened.") - .type(TriggerDefinition.TriggerType.DYNAMIC_WEBHOOK) - .properties() - .output() - .webhookEnable(BrevoTransactionalEmailOpenedTrigger::webhookEnable) - .webhookDisable(BrevoTransactionalEmailOpenedTrigger::webhookDisable) - .webhookRequest(BrevoTransactionalEmailOpenedTrigger::webhookRequest); + public static final ModifiableTriggerDefinition TRIGGER_DEFINITION = trigger("transactionalEmailOpened") + .title("Transactional Email Opened") + .description("Triggers when transactional email is opened.") + .type(TriggerType.DYNAMIC_WEBHOOK) + .output() + .webhookEnable(BrevoTransactionalEmailOpenedTrigger::webhookEnable) + .webhookDisable(BrevoTransactionalEmailOpenedTrigger::webhookDisable) + .webhookRequest(BrevoTransactionalEmailOpenedTrigger::webhookRequest); private BrevoTransactionalEmailOpenedTrigger() { } - protected static TriggerDefinition.WebhookEnableOutput webhookEnable( + protected static WebhookEnableOutput webhookEnable( Parameters inputParameters, Parameters connectionParameters, String webhookUrl, String workflowExecutionId, TriggerContext context) { - return new TriggerDefinition.WebhookEnableOutput( - Map.of(ID, - BrevoUtils.createWebhook(webhookUrl, context)), - null); + Map body = context.http(http -> http.post("/webhooks")) + .body(Http.Body.of( + "url", webhookUrl, + "events", List.of("opened"))) + .configuration(Http.responseType(Http.ResponseType.JSON)) + .execute() + .getBody(new TypeReference<>() {}); + + return new WebhookEnableOutput(Map.of(ID, body.get(ID)), null); } protected static void webhookDisable( Parameters inputParameters, Parameters connectionParameters, Parameters outputParameters, String workflowExecutionId, TriggerContext context) { - BrevoUtils.deleteWebhook(outputParameters, context); + context.http(http -> http.delete("/webhooks/" + outputParameters.getRequiredInteger(ID))) + .execute(); } protected static Object webhookRequest( - Parameters inputParameters, Parameters connectionParameters, TriggerDefinition.HttpHeaders headers, - TriggerDefinition.HttpParameters parameters, - TriggerDefinition.WebhookBody body, TriggerDefinition.WebhookMethod method, - TriggerDefinition.WebhookEnableOutput output, TriggerContext context) { + Parameters inputParameters, Parameters connectionParameters, HttpHeaders headers, HttpParameters parameters, + WebhookBody body, WebhookMethod method, WebhookEnableOutput output, TriggerContext context) { return body.getContent(); } diff --git a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/util/BrevoUtils.java b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/util/BrevoUtils.java index b85b0a705d..d506c44db6 100644 --- a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/util/BrevoUtils.java +++ b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/util/BrevoUtils.java @@ -17,7 +17,6 @@ package com.bytechef.component.brevo.util; import static com.bytechef.component.brevo.constant.BrevoConstants.EMAIL; -import static com.bytechef.component.brevo.constant.BrevoConstants.ID; import static com.bytechef.component.definition.ComponentDsl.option; import static com.bytechef.component.definition.Context.Http.responseType; @@ -25,7 +24,6 @@ import com.bytechef.component.definition.Context.Http; import com.bytechef.component.definition.Option; import com.bytechef.component.definition.Parameters; -import com.bytechef.component.definition.TriggerContext; import com.bytechef.component.definition.TypeReference; import java.util.ArrayList; import java.util.List; @@ -84,26 +82,4 @@ public static List> getSendersOptions( return options; } - - public static String createWebhook( - String webhookUrl, TriggerContext context) { - - Map body = context.http(http -> http.post("/webhooks")) - .body(Context.Http.Body.of( - "url", webhookUrl, - "events", List.of("opened"))) - .configuration(Context.Http.responseType(Context.Http.ResponseType.JSON)) - .execute() - .getBody(new TypeReference<>() {}); - - return body.get(ID) - .toString(); - } - - public static void deleteWebhook(Parameters outputParameters, Context context) { - context.http(http -> http.delete("/webhooks/" + outputParameters.getString(ID))) - .configuration(Context.Http.responseType(Context.Http.ResponseType.JSON)) - .execute(); - } - } diff --git a/server/libs/modules/components/brevo/src/test/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTriggerTest.java b/server/libs/modules/components/brevo/src/test/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTriggerTest.java index 2e0b373ade..6bc20bd812 100644 --- a/server/libs/modules/components/brevo/src/test/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTriggerTest.java +++ b/server/libs/modules/components/brevo/src/test/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTriggerTest.java @@ -18,75 +18,72 @@ import static com.bytechef.component.brevo.constant.BrevoConstants.ID; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.mockStatic; import static org.mockito.Mockito.when; -import com.bytechef.component.brevo.util.BrevoUtils; +import com.bytechef.component.definition.Context.Http; import com.bytechef.component.definition.Parameters; import com.bytechef.component.definition.TriggerContext; -import com.bytechef.component.definition.TriggerDefinition; -import java.time.LocalDateTime; +import com.bytechef.component.definition.TriggerDefinition.HttpHeaders; +import com.bytechef.component.definition.TriggerDefinition.HttpParameters; +import com.bytechef.component.definition.TriggerDefinition.WebhookBody; +import com.bytechef.component.definition.TriggerDefinition.WebhookEnableOutput; +import com.bytechef.component.definition.TriggerDefinition.WebhookMethod; +import com.bytechef.component.definition.TypeReference; +import com.bytechef.component.test.definition.MockParametersFactory; +import java.util.List; import java.util.Map; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.mockito.MockedStatic; +import org.mockito.ArgumentCaptor; /** * @author Marija Horvat */ class BrevoTransactionalEmailOpenedTriggerTest { - protected TriggerDefinition.WebhookEnableOutput mockedWebhookEnableOutput = - mock(TriggerDefinition.WebhookEnableOutput.class); - protected TriggerDefinition.WebhookBody mockedWebhookBody = mock(TriggerDefinition.WebhookBody.class); - protected TriggerDefinition.HttpHeaders mockedHttpHeaders = mock(TriggerDefinition.HttpHeaders.class); - protected TriggerDefinition.HttpParameters mockedHttpParameters = mock(TriggerDefinition.HttpParameters.class); - protected TriggerDefinition.WebhookMethod mockedWebhookMethod = mock(TriggerDefinition.WebhookMethod.class); - protected Parameters mockedParameters = mock(Parameters.class); - protected TriggerContext mockedTriggerContext = mock(TriggerContext.class); - protected MockedStatic brevoUtilsMockedStatic; - protected String workflowExecutionId = "testWorkflowExecutionId"; + private final WebhookEnableOutput mockedWebhookEnableOutput = mock(WebhookEnableOutput.class); + private final ArgumentCaptor bodyArgumentCaptor = ArgumentCaptor.forClass(Http.Body.class); + private final WebhookBody mockedWebhookBody = mock(WebhookBody.class); + private final HttpHeaders mockedHttpHeaders = mock(HttpHeaders.class); + private final HttpParameters mockedHttpParameters = mock(HttpParameters.class); + private final WebhookMethod mockedWebhookMethod = mock(WebhookMethod.class); + private final Parameters mockedParameters = MockParametersFactory.create(Map.of(ID, "id")); + private final TriggerContext mockedTriggerContext = mock(TriggerContext.class); private final Object mockedObject = mock(Object.class); - - @BeforeEach - public void beforeEach() { - brevoUtilsMockedStatic = mockStatic(BrevoUtils.class); - } - - @AfterEach - public void afterEach() { - brevoUtilsMockedStatic.close(); - } + private final Http.Executor mockedExecutor = mock(Http.Executor.class); + private final Http.Response mockedResponse = mock(Http.Response.class); @Test void testWebhookEnable() { String webhookUrl = "testWebhookUrl"; - - when(mockedParameters.getRequiredString(ID)) - .thenReturn("id"); - - brevoUtilsMockedStatic.when( - () -> BrevoUtils.createWebhook(webhookUrl, mockedTriggerContext)) - .thenReturn("123"); - - TriggerDefinition.WebhookEnableOutput webhookEnableOutput = BrevoTransactionalEmailOpenedTrigger.webhookEnable( + String workflowExecutionId = "testWorkflowExecutionId"; + + when(mockedTriggerContext.http(any())) + .thenReturn(mockedExecutor); + when(mockedExecutor.body(bodyArgumentCaptor.capture())) + .thenReturn(mockedExecutor); + when(mockedExecutor.configuration(any())) + .thenReturn(mockedExecutor); + when(mockedExecutor.execute()) + .thenReturn(mockedResponse); + when(mockedResponse.getBody(any(TypeReference.class))) + .thenReturn(Map.of(ID, "123")); + + WebhookEnableOutput webhookEnableOutput = BrevoTransactionalEmailOpenedTrigger.webhookEnable( mockedParameters, mockedParameters, webhookUrl, workflowExecutionId, mockedTriggerContext); - Map parameters = webhookEnableOutput.parameters(); - LocalDateTime webhookExpirationDate = webhookEnableOutput.webhookExpirationDate(); + WebhookEnableOutput expectedWebhookEnableOutput = new WebhookEnableOutput(Map.of(ID, "123"), null); - Map expectedParameters = Map.of(ID, "123"); + assertEquals(expectedWebhookEnableOutput, webhookEnableOutput); - assertEquals(expectedParameters, parameters); - assertNull(webhookExpirationDate); + Http.Body body = bodyArgumentCaptor.getValue(); + + assertEquals(Map.of("url", webhookUrl, "events", List.of("opened")), body.getContent()); } @Test void testWebhookRequest() { - when(mockedWebhookBody.getContent()) .thenReturn(mockedObject); diff --git a/server/libs/modules/components/brevo/src/test/java/com/bytechef/component/brevo/util/BrevoUtilsTest.java b/server/libs/modules/components/brevo/src/test/java/com/bytechef/component/brevo/util/BrevoUtilsTest.java index 76351bc241..d37afcbe5a 100644 --- a/server/libs/modules/components/brevo/src/test/java/com/bytechef/component/brevo/util/BrevoUtilsTest.java +++ b/server/libs/modules/components/brevo/src/test/java/com/bytechef/component/brevo/util/BrevoUtilsTest.java @@ -23,6 +23,7 @@ import static org.mockito.Mockito.when; import com.bytechef.component.definition.Context; +import com.bytechef.component.definition.Context.Http; import com.bytechef.component.definition.Option; import com.bytechef.component.definition.Parameters; import com.bytechef.component.definition.TypeReference; @@ -41,9 +42,9 @@ class BrevoUtilsTest { option("contact1@test.com", "contact1@test.com"), option("contact2@test.com", "contact2@test.com")); private final Context mockedContext = mock(Context.class); - private final Context.Http.Executor mockedExecutor = mock(Context.Http.Executor.class); + private final Http.Executor mockedExecutor = mock(Http.Executor.class); private final Parameters mockedParameters = mock(Parameters.class); - private final Context.Http.Response mockedResponse = mock(Context.Http.Response.class); + private final Http.Response mockedResponse = mock(Http.Response.class); @BeforeEach void beforeEach() { From 00ac60bef3f8ae3ab57c804738bf581f3197ec77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Monika=20Ku=C5=A1ter?= Date: Mon, 7 Apr 2025 13:13:15 +0200 Subject: [PATCH 3/4] 2040 - json - generated --- .../test/resources/definition/brevo_v1.json | 1284 ++++++++++++++++- 1 file changed, 1283 insertions(+), 1 deletion(-) diff --git a/server/libs/modules/components/brevo/src/test/resources/definition/brevo_v1.json b/server/libs/modules/components/brevo/src/test/resources/definition/brevo_v1.json index 5280027167..2916d767a3 100644 --- a/server/libs/modules/components/brevo/src/test/resources/definition/brevo_v1.json +++ b/server/libs/modules/components/brevo/src/test/resources/definition/brevo_v1.json @@ -1 +1,1283 @@ -{"componentCategories":[{"name":"marketing-automation","label":"Marketing Automation"}],"customAction":null,"customActionHelp":null,"description":"Brevo is an email marketing platform that offers a cloud-based marketing communication software suite with transactional email, marketing automation, customer-relationship management and more.","icon":"path:assets/brevo.svg","tags":null,"metadata":null,"name":"brevo","resources":null,"version":1,"title":"Brevo","actions":[{"batch":null,"deprecated":null,"description":"Creates new contact.","help":null,"metadata":null,"name":"createContact","outputDefinition":{"output":null,"outputResponse":{"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"ID of the created contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"id","type":"INTEGER","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"maxValue":null,"minValue":null,"options":null,"controlType":"INTEGER","optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null,"placeholder":null},"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"ID of the created contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"id","type":"INTEGER","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"maxValue":null,"minValue":null,"options":null,"controlType":"INTEGER","optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null},"properties":[{"advancedOption":null,"description":"Email address of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"email","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Email","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"First name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"FIRSTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"First Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"Last name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"LASTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Last Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"title":"Create Contact","processErrorResponse":null,"workflowNodeDescription":null,"perform":{}},{"batch":null,"deprecated":null,"description":"Updates existing contact.","help":null,"metadata":null,"name":"updateContact","outputDefinition":null,"properties":[{"advancedOption":null,"description":"Email address of the contact to update.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"email","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Email","placeholder":null,"controlType":"SELECT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"New first name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"FIRSTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"First Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"New last name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"LASTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Last Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"title":"Update Contact","processErrorResponse":null,"workflowNodeDescription":null,"perform":{}},{"batch":null,"deprecated":null,"description":"Sends and email from your Brevo account.","help":null,"metadata":null,"name":"sendTransactionalEmail","outputDefinition":{"output":null,"outputResponse":{"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"Message ID of the transactional email sent.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"messageId","type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null,"placeholder":null},"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"Message ID of the transactional email sent.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"messageId","type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null},"properties":[{"advancedOption":null,"description":"Email of the sender from which the emails will be sent.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"senderEmail","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Sender Email","placeholder":null,"controlType":"SELECT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"The To: recipients for the message.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"to","type":"ARRAY","defaultValue":null,"exampleValue":null,"label":"To Recipients","placeholder":null,"items":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"EMAIL","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"maxItems":null,"minItems":1,"multipleValues":null,"options":null,"controlType":"MULTI_SELECT","optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"The Bcc recipients for the message.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"bcc","type":"ARRAY","defaultValue":null,"exampleValue":null,"label":"Bcc Recipients","placeholder":null,"items":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"EMAIL","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"maxItems":null,"minItems":null,"multipleValues":null,"options":null,"controlType":"MULTI_SELECT","optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"The Cc recipients for the message.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"cc","type":"ARRAY","defaultValue":null,"exampleValue":null,"label":"Cc Recipients","placeholder":null,"items":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"EMAIL","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"maxItems":null,"minItems":null,"multipleValues":null,"options":null,"controlType":"MULTI_SELECT","optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"Subject of the email.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"subject","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Subject","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"Content type of the email.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"contentType","type":"STRING","defaultValue":"TEXT","exampleValue":null,"label":"Content Type","placeholder":null,"controlType":"SELECT","languageId":null,"maxLength":null,"minLength":null,"options":[{"description":null,"label":"Text","value":"TEXT"},{"description":null,"label":"HTML","value":"HTML"}],"optionsDataSource":null},{"advancedOption":null,"description":"Plain text body of the message.","displayCondition":"contentType == 'TEXT'","expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"content","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Text Content","placeholder":null,"controlType":"TEXT_AREA","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"HTML body of the message.","displayCondition":"contentType == 'HTML'","expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"content","type":"STRING","defaultValue":null,"exampleValue":null,"label":"HTML Content","placeholder":null,"controlType":"RICH_TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"title":"Send Transactional Email","processErrorResponse":null,"workflowNodeDescription":null,"perform":{}}],"clusterElements":[{"description":"Creates new contact.","name":"createContact","outputDefinition":{"output":null,"outputResponse":{"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"ID of the created contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"id","type":"INTEGER","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"maxValue":null,"minValue":null,"options":null,"controlType":"INTEGER","optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null,"placeholder":null},"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"ID of the created contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"id","type":"INTEGER","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"maxValue":null,"minValue":null,"options":null,"controlType":"INTEGER","optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null},"properties":[{"advancedOption":null,"description":"Email address of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"email","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Email","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"First name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"FIRSTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"First Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"Last name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"LASTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Last Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"title":"Create Contact","type":{"name":"TOOLS","key":"tools","label":"Tools","multipleElements":true,"required":false},"element":{}},{"description":"Updates existing contact.","name":"updateContact","outputDefinition":null,"properties":[{"advancedOption":null,"description":"Email address of the contact to update.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"email","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Email","placeholder":null,"controlType":"SELECT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"New first name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"FIRSTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"First Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"New last name of the contact.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"LASTNAME","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Last Name","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"title":"Update Contact","type":{"name":"TOOLS","key":"tools","label":"Tools","multipleElements":true,"required":false},"element":{}},{"description":"Sends and email from your Brevo account.","name":"sendTransactionalEmail","outputDefinition":{"output":null,"outputResponse":{"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"Message ID of the transactional email sent.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"messageId","type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null,"placeholder":null},"outputSchema":{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"OBJECT","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"additionalProperties":null,"multipleValues":null,"options":null,"properties":[{"advancedOption":null,"description":"Message ID of the transactional email sent.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":"messageId","type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"controlType":"OBJECT_BUILDER","optionsDataSource":null},"sampleOutput":null},"properties":[{"advancedOption":null,"description":"Email of the sender from which the emails will be sent.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"senderEmail","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Sender Email","placeholder":null,"controlType":"SELECT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"The To: recipients for the message.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"to","type":"ARRAY","defaultValue":null,"exampleValue":null,"label":"To Recipients","placeholder":null,"items":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"EMAIL","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"maxItems":null,"minItems":1,"multipleValues":null,"options":null,"controlType":"MULTI_SELECT","optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"The Bcc recipients for the message.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"bcc","type":"ARRAY","defaultValue":null,"exampleValue":null,"label":"Bcc Recipients","placeholder":null,"items":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"EMAIL","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"maxItems":null,"minItems":null,"multipleValues":null,"options":null,"controlType":"MULTI_SELECT","optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"The Cc recipients for the message.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":false,"name":"cc","type":"ARRAY","defaultValue":null,"exampleValue":null,"label":"Cc Recipients","placeholder":null,"items":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":null,"name":null,"type":"STRING","defaultValue":null,"exampleValue":null,"label":null,"placeholder":null,"controlType":"EMAIL","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"maxItems":null,"minItems":null,"multipleValues":null,"options":null,"controlType":"MULTI_SELECT","optionsDataSource":{"optionsLookupDependsOn":null,"options":{}}},{"advancedOption":null,"description":"Subject of the email.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"subject","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Subject","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"Content type of the email.","displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"contentType","type":"STRING","defaultValue":"TEXT","exampleValue":null,"label":"Content Type","placeholder":null,"controlType":"SELECT","languageId":null,"maxLength":null,"minLength":null,"options":[{"description":null,"label":"Text","value":"TEXT"},{"description":null,"label":"HTML","value":"HTML"}],"optionsDataSource":null},{"advancedOption":null,"description":"Plain text body of the message.","displayCondition":"contentType == 'TEXT'","expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"content","type":"STRING","defaultValue":null,"exampleValue":null,"label":"Text Content","placeholder":null,"controlType":"TEXT_AREA","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":"HTML body of the message.","displayCondition":"contentType == 'HTML'","expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"content","type":"STRING","defaultValue":null,"exampleValue":null,"label":"HTML Content","placeholder":null,"controlType":"RICH_TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"title":"Send Transactional Email","type":{"name":"TOOLS","key":"tools","label":"Tools","multipleElements":true,"required":false},"element":{}}],"unifiedApi":null,"triggers":[{"batch":null,"deprecated":null,"description":"Triggers when transactional email is opened.","help":null,"name":"transactionalEmailOpened","outputDefinition":{"output":null,"outputResponse":null,"outputSchema":null,"sampleOutput":null},"properties":[],"title":"Transactional Email Opened","type":"DYNAMIC_WEBHOOK","webhookRawBody":null,"workflowSyncExecution":null,"poll":null,"deduplicate":null,"webhookDisable":{},"webhookEnable":{},"dynamicWebhookRefresh":null,"processErrorResponse":null,"workflowNodeDescription":null,"webhookRequest":{},"listenerDisable":null,"listenerEnable":null,"webhookValidate":null,"webhookValidateOnEnable":null}],"connection":{"authorizations":[{"detectOn":null,"description":null,"name":"api_key","properties":[{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":true,"metadata":{},"required":true,"name":"key","type":"STRING","defaultValue":"api-key","exampleValue":null,"label":"Key","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null},{"advancedOption":null,"description":null,"displayCondition":null,"expressionEnabled":null,"hidden":null,"metadata":{},"required":true,"name":"value","type":"STRING","defaultValue":null,"exampleValue":null,"label":"API key","placeholder":null,"controlType":"TEXT","languageId":null,"maxLength":null,"minLength":null,"options":null,"optionsDataSource":null}],"refreshOn":null,"title":"API Key","type":"API_KEY","acquire":null,"refresh":null,"scopes":null,"apply":null,"pkce":null,"authorizationCallback":null,"authorizationUrl":null,"clientId":null,"clientSecret":null,"oauth2AuthorizationExtraQueryParameters":null,"refreshUrl":null,"refreshToken":null,"tokenUrl":null}],"properties":null,"version":1,"authorizationRequired":null,"baseUri":{},"test":null}} \ No newline at end of file +{ + "componentCategories" : [ { + "name" : "marketing-automation", + "label" : "Marketing Automation" + } ], + "customAction" : null, + "customActionHelp" : null, + "description" : "Brevo is an email marketing platform that offers a cloud-based marketing communication software suite with transactional email, marketing automation, customer-relationship management and more.", + "icon" : "path:assets/brevo.svg", + "tags" : null, + "metadata" : null, + "name" : "brevo", + "resources" : null, + "version" : 1, + "title" : "Brevo", + "actions" : [ { + "batch" : null, + "deprecated" : null, + "description" : "Creates new contact.", + "help" : null, + "metadata" : null, + "name" : "createContact", + "outputDefinition" : { + "output" : null, + "outputResponse" : { + "outputSchema" : { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "OBJECT", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "additionalProperties" : null, + "multipleValues" : null, + "options" : null, + "properties" : [ { + "advancedOption" : null, + "description" : "ID of the created contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : "id", + "type" : "INTEGER", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "maxValue" : null, + "minValue" : null, + "options" : null, + "controlType" : "INTEGER", + "optionsDataSource" : null + } ], + "controlType" : "OBJECT_BUILDER", + "optionsDataSource" : null + }, + "sampleOutput" : null, + "placeholder" : null + }, + "outputSchema" : { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "OBJECT", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "additionalProperties" : null, + "multipleValues" : null, + "options" : null, + "properties" : [ { + "advancedOption" : null, + "description" : "ID of the created contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : "id", + "type" : "INTEGER", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "maxValue" : null, + "minValue" : null, + "options" : null, + "controlType" : "INTEGER", + "optionsDataSource" : null + } ], + "controlType" : "OBJECT_BUILDER", + "optionsDataSource" : null + }, + "sampleOutput" : null + }, + "properties" : [ { + "advancedOption" : null, + "description" : "Email address of the contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "email", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Email", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "First name of the contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : false, + "name" : "FIRSTNAME", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "First Name", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "Last name of the contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : false, + "name" : "LASTNAME", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Last Name", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "title" : "Create Contact", + "perform" : { }, + "workflowNodeDescription" : null, + "processErrorResponse" : null + }, { + "batch" : null, + "deprecated" : null, + "description" : "Updates existing contact.", + "help" : null, + "metadata" : null, + "name" : "updateContact", + "outputDefinition" : null, + "properties" : [ { + "advancedOption" : null, + "description" : "Email address of the contact to update.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "email", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Email", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : { + "optionsLookupDependsOn" : null, + "options" : { } + } + }, { + "advancedOption" : null, + "description" : "New first name of the contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : false, + "name" : "FIRSTNAME", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "First Name", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "New last name of the contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : false, + "name" : "LASTNAME", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Last Name", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "title" : "Update Contact", + "perform" : { }, + "workflowNodeDescription" : null, + "processErrorResponse" : null + }, { + "batch" : null, + "deprecated" : null, + "description" : "Sends and email from your Brevo account.", + "help" : null, + "metadata" : null, + "name" : "sendTransactionalEmail", + "outputDefinition" : { + "output" : null, + "outputResponse" : { + "outputSchema" : { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "OBJECT", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "additionalProperties" : null, + "multipleValues" : null, + "options" : null, + "properties" : [ { + "advancedOption" : null, + "description" : "Message ID of the transactional email sent.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : "messageId", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "controlType" : "OBJECT_BUILDER", + "optionsDataSource" : null + }, + "sampleOutput" : null, + "placeholder" : null + }, + "outputSchema" : { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "OBJECT", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "additionalProperties" : null, + "multipleValues" : null, + "options" : null, + "properties" : [ { + "advancedOption" : null, + "description" : "Message ID of the transactional email sent.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : "messageId", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "controlType" : "OBJECT_BUILDER", + "optionsDataSource" : null + }, + "sampleOutput" : null + }, + "properties" : [ { + "advancedOption" : null, + "description" : "Email of the sender from which the emails will be sent.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "senderEmail", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Sender Email", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : { + "optionsLookupDependsOn" : null, + "options" : { } + } + }, { + "advancedOption" : null, + "description" : "The To: recipients for the message.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "to", + "type" : "ARRAY", + "defaultValue" : null, + "exampleValue" : null, + "label" : "To Recipients", + "placeholder" : null, + "items" : [ { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "EMAIL", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "maxItems" : null, + "minItems" : 1, + "multipleValues" : null, + "options" : null, + "controlType" : "MULTI_SELECT", + "optionsDataSource" : { + "optionsLookupDependsOn" : null, + "options" : { } + } + }, { + "advancedOption" : null, + "description" : "The Bcc recipients for the message.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : false, + "name" : "bcc", + "type" : "ARRAY", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Bcc Recipients", + "placeholder" : null, + "items" : [ { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "EMAIL", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "maxItems" : null, + "minItems" : null, + "multipleValues" : null, + "options" : null, + "controlType" : "MULTI_SELECT", + "optionsDataSource" : { + "optionsLookupDependsOn" : null, + "options" : { } + } + }, { + "advancedOption" : null, + "description" : "The Cc recipients for the message.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : false, + "name" : "cc", + "type" : "ARRAY", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Cc Recipients", + "placeholder" : null, + "items" : [ { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "EMAIL", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "maxItems" : null, + "minItems" : null, + "multipleValues" : null, + "options" : null, + "controlType" : "MULTI_SELECT", + "optionsDataSource" : { + "optionsLookupDependsOn" : null, + "options" : { } + } + }, { + "advancedOption" : null, + "description" : "Subject of the email.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "subject", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Subject", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "Content type of the email.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "contentType", + "type" : "STRING", + "defaultValue" : "TEXT", + "exampleValue" : null, + "label" : "Content Type", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : null, + "label" : "Text", + "value" : "TEXT" + }, { + "description" : null, + "label" : "HTML", + "value" : "HTML" + } ], + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "Plain text body of the message.", + "displayCondition" : "contentType == 'TEXT'", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "content", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Text Content", + "placeholder" : null, + "controlType" : "TEXT_AREA", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "HTML body of the message.", + "displayCondition" : "contentType == 'HTML'", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "content", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "HTML Content", + "placeholder" : null, + "controlType" : "RICH_TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "title" : "Send Transactional Email", + "perform" : { }, + "workflowNodeDescription" : null, + "processErrorResponse" : null + } ], + "clusterElements" : [ { + "description" : "Creates new contact.", + "name" : "createContact", + "outputDefinition" : { + "output" : null, + "outputResponse" : { + "outputSchema" : { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "OBJECT", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "additionalProperties" : null, + "multipleValues" : null, + "options" : null, + "properties" : [ { + "advancedOption" : null, + "description" : "ID of the created contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : "id", + "type" : "INTEGER", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "maxValue" : null, + "minValue" : null, + "options" : null, + "controlType" : "INTEGER", + "optionsDataSource" : null + } ], + "controlType" : "OBJECT_BUILDER", + "optionsDataSource" : null + }, + "sampleOutput" : null, + "placeholder" : null + }, + "outputSchema" : { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "OBJECT", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "additionalProperties" : null, + "multipleValues" : null, + "options" : null, + "properties" : [ { + "advancedOption" : null, + "description" : "ID of the created contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : "id", + "type" : "INTEGER", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "maxValue" : null, + "minValue" : null, + "options" : null, + "controlType" : "INTEGER", + "optionsDataSource" : null + } ], + "controlType" : "OBJECT_BUILDER", + "optionsDataSource" : null + }, + "sampleOutput" : null + }, + "properties" : [ { + "advancedOption" : null, + "description" : "Email address of the contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "email", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Email", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "First name of the contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : false, + "name" : "FIRSTNAME", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "First Name", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "Last name of the contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : false, + "name" : "LASTNAME", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Last Name", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "title" : "Create Contact", + "type" : { + "name" : "TOOLS", + "key" : "tools", + "label" : "Tools", + "multipleElements" : true, + "required" : false + }, + "element" : { } + }, { + "description" : "Updates existing contact.", + "name" : "updateContact", + "outputDefinition" : null, + "properties" : [ { + "advancedOption" : null, + "description" : "Email address of the contact to update.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "email", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Email", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : { + "optionsLookupDependsOn" : null, + "options" : { } + } + }, { + "advancedOption" : null, + "description" : "New first name of the contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : false, + "name" : "FIRSTNAME", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "First Name", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "New last name of the contact.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : false, + "name" : "LASTNAME", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Last Name", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "title" : "Update Contact", + "type" : { + "name" : "TOOLS", + "key" : "tools", + "label" : "Tools", + "multipleElements" : true, + "required" : false + }, + "element" : { } + }, { + "description" : "Sends and email from your Brevo account.", + "name" : "sendTransactionalEmail", + "outputDefinition" : { + "output" : null, + "outputResponse" : { + "outputSchema" : { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "OBJECT", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "additionalProperties" : null, + "multipleValues" : null, + "options" : null, + "properties" : [ { + "advancedOption" : null, + "description" : "Message ID of the transactional email sent.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : "messageId", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "controlType" : "OBJECT_BUILDER", + "optionsDataSource" : null + }, + "sampleOutput" : null, + "placeholder" : null + }, + "outputSchema" : { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "OBJECT", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "additionalProperties" : null, + "multipleValues" : null, + "options" : null, + "properties" : [ { + "advancedOption" : null, + "description" : "Message ID of the transactional email sent.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : "messageId", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "controlType" : "OBJECT_BUILDER", + "optionsDataSource" : null + }, + "sampleOutput" : null + }, + "properties" : [ { + "advancedOption" : null, + "description" : "Email of the sender from which the emails will be sent.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "senderEmail", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Sender Email", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : { + "optionsLookupDependsOn" : null, + "options" : { } + } + }, { + "advancedOption" : null, + "description" : "The To: recipients for the message.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "to", + "type" : "ARRAY", + "defaultValue" : null, + "exampleValue" : null, + "label" : "To Recipients", + "placeholder" : null, + "items" : [ { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "EMAIL", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "maxItems" : null, + "minItems" : 1, + "multipleValues" : null, + "options" : null, + "controlType" : "MULTI_SELECT", + "optionsDataSource" : { + "optionsLookupDependsOn" : null, + "options" : { } + } + }, { + "advancedOption" : null, + "description" : "The Bcc recipients for the message.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : false, + "name" : "bcc", + "type" : "ARRAY", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Bcc Recipients", + "placeholder" : null, + "items" : [ { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "EMAIL", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "maxItems" : null, + "minItems" : null, + "multipleValues" : null, + "options" : null, + "controlType" : "MULTI_SELECT", + "optionsDataSource" : { + "optionsLookupDependsOn" : null, + "options" : { } + } + }, { + "advancedOption" : null, + "description" : "The Cc recipients for the message.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : false, + "name" : "cc", + "type" : "ARRAY", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Cc Recipients", + "placeholder" : null, + "items" : [ { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "EMAIL", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "maxItems" : null, + "minItems" : null, + "multipleValues" : null, + "options" : null, + "controlType" : "MULTI_SELECT", + "optionsDataSource" : { + "optionsLookupDependsOn" : null, + "options" : { } + } + }, { + "advancedOption" : null, + "description" : "Subject of the email.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "subject", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Subject", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "Content type of the email.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "contentType", + "type" : "STRING", + "defaultValue" : "TEXT", + "exampleValue" : null, + "label" : "Content Type", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : null, + "label" : "Text", + "value" : "TEXT" + }, { + "description" : null, + "label" : "HTML", + "value" : "HTML" + } ], + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "Plain text body of the message.", + "displayCondition" : "contentType == 'TEXT'", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "content", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Text Content", + "placeholder" : null, + "controlType" : "TEXT_AREA", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "HTML body of the message.", + "displayCondition" : "contentType == 'HTML'", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "content", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "HTML Content", + "placeholder" : null, + "controlType" : "RICH_TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "title" : "Send Transactional Email", + "type" : { + "name" : "TOOLS", + "key" : "tools", + "label" : "Tools", + "multipleElements" : true, + "required" : false + }, + "element" : { } + } ], + "unifiedApi" : null, + "triggers" : [ { + "batch" : null, + "deprecated" : null, + "description" : "Triggers when transactional email is opened.", + "help" : null, + "name" : "transactionalEmailOpened", + "outputDefinition" : { + "output" : null, + "outputResponse" : null, + "outputSchema" : null, + "sampleOutput" : null + }, + "properties" : null, + "title" : "Transactional Email Opened", + "type" : "DYNAMIC_WEBHOOK", + "webhookRawBody" : null, + "workflowSyncExecution" : null, + "poll" : null, + "deduplicate" : null, + "webhookDisable" : { }, + "webhookEnable" : { }, + "dynamicWebhookRefresh" : null, + "workflowNodeDescription" : null, + "processErrorResponse" : null, + "webhookRequest" : { }, + "listenerDisable" : null, + "listenerEnable" : null, + "webhookValidate" : null, + "webhookValidateOnEnable" : null + } ], + "connection" : { + "authorizations" : [ { + "detectOn" : null, + "description" : null, + "name" : "api_key", + "properties" : [ { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : true, + "metadata" : { }, + "required" : true, + "name" : "key", + "type" : "STRING", + "defaultValue" : "api-key", + "exampleValue" : null, + "label" : "Key", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "value", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "API key", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "refreshOn" : null, + "title" : "API Key", + "type" : "API_KEY", + "acquire" : null, + "apply" : null, + "authorizationCallback" : null, + "authorizationUrl" : null, + "clientId" : null, + "clientSecret" : null, + "oauth2AuthorizationExtraQueryParameters" : null, + "pkce" : null, + "refresh" : null, + "refreshUrl" : null, + "scopes" : null, + "refreshToken" : null, + "tokenUrl" : null + } ], + "properties" : null, + "version" : 1, + "authorizationRequired" : null, + "baseUri" : { }, + "test" : null + } +} \ No newline at end of file From c6ef72c21a6d15ba57513dbf7b6cb6472aa5e92d Mon Sep 17 00:00:00 2001 From: Ivica Cardic Date: Sun, 13 Apr 2025 21:10:40 +0200 Subject: [PATCH 4/4] 2040 - SF --- .../brevo/trigger/BrevoTransactionalEmailOpenedTrigger.java | 4 +--- .../java/com/bytechef/component/brevo/util/BrevoUtils.java | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTrigger.java b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTrigger.java index e8194f13df..48502be99d 100644 --- a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTrigger.java +++ b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/trigger/BrevoTransactionalEmailOpenedTrigger.java @@ -55,9 +55,7 @@ protected static WebhookEnableOutput webhookEnable( String workflowExecutionId, TriggerContext context) { Map body = context.http(http -> http.post("/webhooks")) - .body(Http.Body.of( - "url", webhookUrl, - "events", List.of("opened"))) + .body(Http.Body.of("url", webhookUrl, "events", List.of("opened"))) .configuration(Http.responseType(Http.ResponseType.JSON)) .execute() .getBody(new TypeReference<>() {}); diff --git a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/util/BrevoUtils.java b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/util/BrevoUtils.java index d506c44db6..74e3ab2d71 100644 --- a/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/util/BrevoUtils.java +++ b/server/libs/modules/components/brevo/src/main/java/com/bytechef/component/brevo/util/BrevoUtils.java @@ -41,8 +41,7 @@ public static List> getContactsOptions( Parameters inputParameters, Parameters connectionParameters, Map dependencyPaths, String searchText, Context context) { - Map body = context - .http(http -> http.get("/contacts")) + Map body = context.http(http -> http.get("/contacts")) .configuration(responseType(Http.ResponseType.JSON)) .execute() .getBody(new TypeReference<>() {}); @@ -66,8 +65,7 @@ public static List> getSendersOptions( Parameters inputParameters, Parameters connectionParameters, Map dependencyPaths, String searchText, Context context) { - Map>> body = context - .http(http -> http.get("/senders")) + Map>> body = context.http(http -> http.get("/senders")) .configuration(responseType(Http.ResponseType.JSON)) .execute() .getBody(new TypeReference<>() {});