The Power Automate example solution showcases how to connect your Teneo bot with a flow created in Power Automate. The solution contains a Power Automate integration and an example flow that can be used to send an email in Outlook via Power Automate. As the integration source code is embedded in the solution, it can easily be extended or used as a starting point for new methods.
The solution contains a Power Automate backend integration with a method for sending an email in Outlook via Power Automate. This method is used in the example flow, ‘User wants to send email’.
The solution uses a flow in Power Automate that is triggered by an HTTP request. Power Automate offers many different actions to be used in flows, meaning this solution can easily be used with other flows to achieve different goals. In this example Power Automate flow, a trigger goes off when the HTTP request is received and the flow goes on to the next step in which the email is sent.
In order to use this solution, you will need a Power Automate account in which to create a flow. These instructions also assume you have downloaded and imported the Power Automate solution. See instructions below.
In this step, we will create a flow in Power Automate that will send out an email when we call on it from our Teneo solution.
When an HTTP request is received
. The trigger will be marked with a green [Premium].{
"type": "object",
"properties": {
"emailTo": {
"type": "string"
},
"emailSubject": {
"type": "string"
},
"emailBody": {
"type": "string"
}
}
}
/SendMail
.Send an email (V2) Office 365 Outlook
not Outlook.com.If you are not automatically signed in to Outlook, please press the 'Sign in' button and enter your credentials.
Your flow should now look like this:
There is one global variable in the Teneo Power Automate solution in which you will need to store a URL pointing to your Power Automate flow.
Variable Name | Example value | Description |
---|---|---|
powerAutomateURL | 'https://prod-XX.westeurope.logic.azure.com/workflows/XXXX/triggers/manual/paths/invoke/SendMail?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=XXXXX' | HTTP Post URL from the Power Automate flow trigger 'When a HTTP request is received'. |
Now that you have created your Power Automate flow and saved the link to it in a global variable in your Teneo solution, it's time to test it all out.
You will now see the message 'To see it work now, perform the starting action.' This means you can go into Try Out in Teneo Studio and ask it to send an email. Let us test this out by telling the bot the following, I want to send an email
and carrying out the following conversation:
User: I want to send an email
Bot: Who would you like to send the email to?
User: teneo@example.com
Bot: What is the subject of the email?
User: Power Automate
Bot: What would you like your email to say?
User: This is an email from Power Automate.
Bot: Is the following information correct?
To: teneo@example.com
Subject: Power Automate
Message body: This is an email from Power Automate.
User: Yes
Bot: Your email has been sent.
Once you have the connector running, you no longer need to start the manual test in your Power Automate flow. To use it, simply make sure it is turned on and it should work each time you call it from your bot.
Was this page helpful?