diff --git a/resources/Send an SMS notification about upcoming offers for Shopify customers using text from IBM watsonx ai.yaml b/resources/Send an SMS notification about upcoming offers for Shopify customers using text from IBM watsonx ai.yaml new file mode 100644 index 000000000..c8174b39e --- /dev/null +++ b/resources/Send an SMS notification about upcoming offers for Shopify customers using text from IBM watsonx ai.yaml @@ -0,0 +1,241 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + connector-type: streaming-connector-scheduler + type: event-trigger + triggers: + SCHEDULE: + input-context: + data: scheduler + assembly: + $ref: '#/integration/assemblies/assembly-1' + options: + subscription: + scheduleConfiguration: + interval: + unit: minute + value: 1 + runOnceOncheck: true + days: + - MON + - TUE + - WED + - THU + - FRI + - SAT + - SUN + timeZone: UTC + action-interfaces: + action-interface-2: + type: api-action + business-object: postListsByContactListIdContacts_model + connector-type: clicksend + actions: + postListsByContactListIdContacts: {} + action-interface-3: + type: api-action + business-object: postSmsCampaignsSend_model + connector-type: clicksend + actions: + postSmsCampaignsSend: {} + action-interface-5: + type: api-action + business-object: customer + connector-type: shopify + actions: + RETRIEVEALL: {} + action-interface-1: + type: api-action + business-object: postLists_model + connector-type: clicksend + actions: + postLists: {} + action-interface-4: + type: api-action + business-object: postMlV1TextGeneration_model + connector-type: ibmwatsonxai + actions: + postMlV1TextGeneration: {} + assemblies: + assembly-1: + assembly: + execute: + - retrieve-action: + name: Shopify Retrieve customers + target: + $ref: '#/integration/action-interfaces/action-interface-5' + filter: + limit: 1 + where: + first_name: ABCDD + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ShopifyCreatecustomer + $ref: '#/node-output/Shopify Create customer/response/payload' + - variable: flowDetails + $ref: '#/flowDetails' + allow-truncation: true + pagination-type: TOKEN + allow-empty-output: false + - custom-action: + name: ClickSend Create contact list + target: + $ref: '#/integration/action-interfaces/action-interface-1' + action: postLists + map: + mappings: + - list_name: + template: Upcoming Sale {{$Trigger.lastEventTime}} + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ShopifyRetrievecustomers + $ref: '#/node-output/Shopify Retrieve customers/response/payload' + - variable: ShopifyRetrievecustomersMetadata + $ref: '#/node-output/Shopify Retrieve customers/response' + - variable: flowDetails + $ref: '#/flowDetails' + - for-each: + name: For each + assembly: + $ref: '#/integration/assemblies/assembly-2' + source: + expression: '$ShopifyRetrievecustomers ' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ShopifyRetrievecustomers + $ref: '#/node-output/Shopify Retrieve customers/response/payload' + - variable: ShopifyRetrievecustomersMetadata + $ref: '#/node-output/Shopify Retrieve customers/response' + - variable: ClickSendCreatecontactlist + $ref: >- + #/node-output/ClickSend Create contact + list/response/payload + - variable: flowDetails + $ref: '#/flowDetails' + mode: parallel + continue-on-error: true + map: + $map: http://ibm.com/appconnect/map/v1 + mappings: [] + display-name: Square Phone number + - custom-action: + action: postMlV1TextGeneration + name: IBM watsonx.ai Generate text + target: + $ref: '#/integration/action-interfaces/action-interface-4' + map: + mappings: + - input: + template: >- + Create an irresistible and fun SMS message offering a + 15% discount on all products. Use the code 'PERSONAL10' + to unlock the deal. Make it exciting and use marketing + startegies to maximize customer excitement!,complete the + sms text. + - model_id: + template: meta-llama/llama-2-70b-chat + - parameters: + mappings: + - max_new_tokens: + expression: '300' + - time_limit: + expression: '10000' + - project_id: + template: 5a745c74-c93f-4cbd-ba70-bf0a93633fbd + - version: + template: '2024-03-14' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ShopifyRetrievecustomers + $ref: '#/node-output/Shopify Retrieve customers/response/payload' + - variable: ShopifyRetrievecustomersMetadata + $ref: '#/node-output/Shopify Retrieve customers/response' + - variable: ClickSendCreatecontactlist + $ref: >- + #/node-output/ClickSend Create contact + list/response/payload + - variable: Foreach + $ref: '#/node-output/For each/response/payload' + - variable: flowDetails + $ref: '#/flowDetails' + - custom-action: + name: ClickSend Create SMS campaign + target: + $ref: '#/integration/action-interfaces/action-interface-3' + action: postSmsCampaignsSend + map: + mappings: + - body: + template: '{{$IBMWatsonXAIGenerateText.results.generated_text}}' + - from: + template: '+61411111111' + - list_id: + template: '{{$ClickSendCreatecontactlist.list_id}}' + - name: + template: Sale Campaign + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ShopifyRetrievecustomers + $ref: '#/node-output/Shopify Retrieve customers/response/payload' + - variable: ShopifyRetrievecustomersMetadata + $ref: '#/node-output/Shopify Retrieve customers/response' + - variable: ClickSendCreatecontactlist + $ref: >- + #/node-output/ClickSend Create contact + list/response/payload + - variable: Foreach + $ref: '#/node-output/For each/response/payload' + - variable: IBMWatsonXAIGenerateText + $ref: >- + #/node-output/IBM WatsonX.AI Generate + Text/response/payload + - variable: flowDetails + $ref: '#/flowDetails' + assembly-2: + assembly: + execute: + - custom-action: + name: ClickSend Create contact in contact list + target: + $ref: '#/integration/action-interfaces/action-interface-2' + action: postListsByContactListIdContacts + map: + mappings: + - address_line_1: + template: address line 1 + - contactListId: + template: '{{$ClickSendCreatecontactlist.list_id}}' + - email: + template: '{{$ShopifyRetrievecustomers.email}}' + - first_name: + template: '{{$ShopifyRetrievecustomers.first_name}}' + - phone_number: + template: '{{$ShopifyRetrievecustomers.phone}}' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ShopifyRetrievecustomers + $ref: '#/node-output/Shopify Retrieve customers/response/payload' + - variable: ShopifyRetrievecustomersMetadata + $ref: '#/node-output/Shopify Retrieve customers/response' + - variable: ClickSendCreatecontactlist + $ref: >- + #/node-output/ClickSend Create contact + list/response/payload + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: flowDetails + $ref: '#/flowDetails' + name: Send an SMS notification about upcoming offers for Shopify customers using text from IBM watsonx ai +models: {} diff --git a/resources/Summarize the open leads from Salesforce using IBM watsonx ai and send an email.yaml b/resources/Summarize the open leads from Salesforce using IBM watsonx ai and send an email.yaml new file mode 100644 index 000000000..52d876920 --- /dev/null +++ b/resources/Summarize the open leads from Salesforce using IBM watsonx ai and send an email.yaml @@ -0,0 +1,302 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + type: event-trigger + connector-type: streaming-connector-scheduler + triggers: + SCHEDULE: + assembly: + $ref: '#/integration/assemblies/assembly-1' + input-context: + data: scheduler + options: + subscription: + scheduleConfiguration: + interval: + unit: minute + value: 5 + runOnceOncheck: true + days: + - MON + - TUE + - WED + - THU + - FRI + - SAT + - SUN + timeZone: UTC + action-interfaces: + action-interface-2: + type: api-action + business-object: Lead + connector-type: salesforce + actions: + RETRIEVEALL: {} + action-interface-1: + type: api-action + business-object: postCustomSummary_model + connector-type: ibmwatsonxai + actions: + postCustomSummary: {} + action-interface-4: + type: api-action + business-object: postMlV1TextGeneration_model + connector-type: ibmwatsonxai + actions: + postMlV1TextGeneration: {} + action-interface-5: + type: api-action + business-object: mail + connector-type: gmail + actions: + CREATE: {} + action-interface-3: + type: api-action + business-object: User + connector-type: salesforce + actions: + RETRIEVEALL: {} + assemblies: + assembly-1: + assembly: + execute: + - retrieve-action: + allow-empty-output: false + allow-truncation: true + name: Salesforce Retrieve users + target: + $ref: '#/integration/action-interfaces/action-interface-3' + filter: + limit: 10 + pagination-type: TOKEN + - if: + branch: + - condition: + '{{$SalesforceRetrieveusersMetadata."status-code"}}': '200' + execute: + - for-each: + map: + $map: http://ibm.com/appconnect/map/v1 + mappings: [] + source: + expression: '$SalesforceRetrieveusers ' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: SalesforceRetrieveusers + $ref: >- + #/node-output/Salesforce Retrieve + users/response/payload + - variable: SalesforceRetrieveusersMetadata + $ref: '#/node-output/Salesforce Retrieve users/response' + - variable: flowDetails + $ref: '#/flowDetails' + mode: sequential + continue-on-error: true + name: For each 2 + assembly: + $ref: '#/integration/assemblies/assembly-4' + display-name: Salesforce User + else: + execute: [] + name: If + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: SalesforceRetrieveusers + $ref: '#/node-output/Salesforce Retrieve users/response/payload' + - variable: SalesforceRetrieveusersMetadata + $ref: '#/node-output/Salesforce Retrieve users/response' + - variable: flowDetails + $ref: '#/flowDetails' + assembly-2: + assembly: + execute: + - custom-action: + action: postCustomEmail + name: IBM watsonx.ai Generate email template + target: + $ref: '#/integration/action-interfaces/action-interface-1' + map: + mappings: + - input: + template: 'Generate an email without subject to ' + - model_id: + template: ibm/granite-13b-chat-v2 + - version: + template: '2024-03-14' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: SalesforceRetrieveleads + $ref: '#/node-output/Salesforce Retrieve leads/response/payload' + - variable: SalesforceRetrieveleadsMetadata + $ref: '#/node-output/Salesforce Retrieve leads/response' + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: flowDetails + $ref: '#/flowDetails' + assembly-4: + assembly: + execute: + - retrieve-action: + allow-empty-output: true + allow-truncation: true + name: Salesforce Retrieve leads + target: + $ref: '#/integration/action-interfaces/action-interface-2' + filter: + limit: 10 + where: + and: + - IsUnreadByOwner: 'true' + - Status: Open - Not Contacted + - OwnerId: '{{$Foreach2item.Id}}' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: SalesforceRetrieveusers + $ref: '#/node-output/Salesforce Retrieve users/response/payload' + - variable: SalesforceRetrieveusersMetadata + $ref: '#/node-output/Salesforce Retrieve users/response' + - variable: Foreach2item + $ref: '#/block/For each 2/current-item' + - variable: flowDetails + $ref: '#/flowDetails' + pagination-type: TOKEN + - if: + branch: + - condition: + '{{$SalesforceRetrieveleadsMetadata."status-code"}}': '200' + execute: + - custom-action: + action: postMlV1TextGeneration + name: IBM watsonx.ai Generate text + target: + $ref: '#/integration/action-interfaces/action-interface-4' + map: + mappings: + - input: + template: >- + Summarise the given open uncontacted list of + lead records: + {{$SalesforceRetrieveleads.{'Name':Name, + 'Title': Title, 'Company': Company, + 'Email':Email, 'Lead Creation Date': + CreatedDate} }} for {{$Foreach2item.Name}}. + For context the list provided above contains + details of customers that need to be reached + out, and {{$Foreach2item.Name}} is the owner + and needs to reach out, so write a summary for + {{$Foreach2item.Name}} so they can get started + asap. Consider only the data and fields that + are mentioned in the list and display them + clearly in a numbered list, show the 'lead + creation date' in a user readable format + (DD/MM/YYYY) and segregate the entries per + lead record, no salutations/addressing at the + end and no hints of previous responses and + prompts. + - model_id: + template: ibm/granite-13b-chat-v2 + - parameters: + mappings: + - max_new_tokens: + expression: '800' + - min_new_tokens: + expression: '200' + - time_limit: + expression: '17000' + - project_id: + template: 5a745c74-c93f-4cbd-ba70-bf0a93633fbd + - version: + template: '2024-03-14' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: SalesforceRetrieveusers + $ref: >- + #/node-output/Salesforce Retrieve + users/response/payload + - variable: SalesforceRetrieveusersMetadata + $ref: '#/node-output/Salesforce Retrieve users/response' + - variable: SalesforceRetrieveleads + $ref: >- + #/block/For each 2/node-output/Salesforce + Retrieve leads/response/payload + - variable: SalesforceRetrieveleadsMetadata + $ref: >- + #/block/For each 2/node-output/Salesforce + Retrieve leads/response + - variable: Foreach2item + $ref: '#/block/For each 2/current-item' + - variable: flowDetails + $ref: '#/flowDetails' + - create-action: + name: Gmail Send email + target: + $ref: '#/integration/action-interfaces/action-interface-5' + map: + mappings: + - Subject: + template: Summary of Leads for {{$Foreach2item.Name}} + - To: + template: '{{$Foreach2item.Email}}' + - richTextBody: + mappings: + - content: + template: >- + {{$IBMWatsonXAIGenerateText.results.generated_text}} + - contentType: + template: text/plain + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: SalesforceRetrieveusers + $ref: >- + #/node-output/Salesforce Retrieve + users/response/payload + - variable: SalesforceRetrieveusersMetadata + $ref: '#/node-output/Salesforce Retrieve users/response' + - variable: SalesforceRetrieveleads + $ref: >- + #/block/For each 2/node-output/Salesforce + Retrieve leads/response/payload + - variable: SalesforceRetrieveleadsMetadata + $ref: >- + #/block/For each 2/node-output/Salesforce + Retrieve leads/response + - variable: Foreach2item + $ref: '#/block/For each 2/current-item' + - variable: flowDetails + $ref: '#/flowDetails' + else: + execute: [] + name: If 2 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: SalesforceRetrieveusers + $ref: '#/node-output/Salesforce Retrieve users/response/payload' + - variable: SalesforceRetrieveusersMetadata + $ref: '#/node-output/Salesforce Retrieve users/response' + - variable: SalesforceRetrieveleads + $ref: >- + #/block/For each 2/node-output/Salesforce Retrieve + leads/response/payload + - variable: SalesforceRetrieveleadsMetadata + $ref: >- + #/block/For each 2/node-output/Salesforce Retrieve + leads/response + - variable: Foreach2item + $ref: '#/block/For each 2/current-item' + - variable: flowDetails + $ref: '#/flowDetails' + name: >- + Summarize the open leads from Salesforce using IBM watsonx ai and send an email +models: {} diff --git a/resources/markdown/Send an SMS notification about upcoming offers for Shopify customers using text from IBM watsonx ai_instructions.md b/resources/markdown/Send an SMS notification about upcoming offers for Shopify customers using text from IBM watsonx ai_instructions.md new file mode 100644 index 000000000..ec596ba0e --- /dev/null +++ b/resources/markdown/Send an SMS notification about upcoming offers for Shopify customers using text from IBM watsonx ai_instructions.md @@ -0,0 +1,11 @@ +To refer to these instructions while editing the flow, open [the GitHub page](https://github.com/ot4i/app-connect-templates/blob/main/resources/markdown/Send%20an%20SMS%20notification%20about%20upcoming%20offers%20for%20Shopify%20customers%20using%20text%20from%20IBM%20watsonx%20ai_instructions.md) (opens in a new window). + +1. Click **Use this template** to start using the template. +2. Connect to the following accounts by using your credentials: + - [Shopify](https://www.ibm.com/docs/en/app-connect/saas?topic=apps-shopify) + - [IBM watsonx.ai](https://www.ibm.com/docs/en/app-connect/saas?topic=apps-watsonxai) + - [ClickSend]([https://www.ibm.com/docs/en/app-connect/saas?topic=apps-clicksend) +3. To start the flow, in the banner, click **Start flow**. + + +Use this template to send an SMS notification about upcoming offers for Shopify customers using text generated from IBM watsonx.ai. diff --git a/resources/markdown/Summarize the open leads from Salesforce using IBM watsonx ai and send an email_instructions.md b/resources/markdown/Summarize the open leads from Salesforce using IBM watsonx ai and send an email_instructions.md new file mode 100644 index 000000000..8587d4f04 --- /dev/null +++ b/resources/markdown/Summarize the open leads from Salesforce using IBM watsonx ai and send an email_instructions.md @@ -0,0 +1,11 @@ +To refer to these instructions while editing the flow, open [the GitHub page](https://github.com/ot4i/app-connect-templates/blob/main/resources/markdown/Summarize%20the%20open%20leads%20from%20Salesforce%20using%20IBM%20watsonx%20ai%20and%20send%20an%20email_instructions.md) (opens in a new window). + +1. Click **Use this template** to start using the template. +2. Connect to the following accounts by using your credentials: + - [Salesforce](https://www.ibm.com/docs/en/app-connect/saas?topic=apps-hunter) + - [IBM watsonx.ai](https://www.ibm.com/docs/en/app-connect/saas?topic=apps-watsonxai) + - [Gmail](https://www.ibm.com/docs/en/app-connect/saas?topic=apps-gmail) +3. To start the flow, in the banner, click **Start flow**. + + +Use this template to Summarize the open leads from Salesforce using IBM watsonx.ai and send an email. diff --git a/resources/template-metadata.json b/resources/template-metadata.json index e7eb9cff3..745f6a876 100644 --- a/resources/template-metadata.json +++ b/resources/template-metadata.json @@ -3589,6 +3589,24 @@ "targetApps": ["zohocrm"], "tags": ["wufoo", "zohocrm", "if"], "offerings": ["app connect professional"] -} + }, +{ + "name": "Summarize the open leads from Salesforce using IBM watsonx ai and send an email", + "description": "Use this template to send a scheduled mail to a salesforce user with a summary of their open, not contacted, and unread leads using IBM watsonx.ai.", + "summary": "Scheduler to 3 applications", + "sourceApp": "streaming-connector-scheduler", + "targetApps": ["salesforce", "ibmwatsonxai", "gmail"], + "tags": ["streaming-connector-scheduler", "salesforce", "ibmwatsonxai", "gmail", "if", "foreach"], + "offerings": ["app connect professional"] + }, + { + "name": "Send an SMS notification about upcoming offers for Shopify customers using text from IBM watsonx ai", + "description": "Use this template to craft compelling and captivating messages using IBM watsonx.ai to notify Shopify customers about upcoming offers.", + "summary": "Scheduler to 3 applications", + "sourceApp": "streaming-connector-scheduler", + "targetApps": ["shopify", "clicksend", "ibmwatsonxai"], + "tags": ["streaming-connector-scheduler", "shopify", "clicksend", "ibmwatsonxai", "foreach"], + "offerings": ["app connect professional"] + } ] }