question

Siva-2907 avatar image
0 Votes"
Siva-2907 asked BrunoLucas-9843 commented

Can we add a adaptive card in send an email option in Logical app?

Send an email step in logical app - i don't see an option to toggle into code mode to add the adaptive card script.
does the sending an actionable message (adaptive card) via outlook step is supported in Azure logical apps?

azure-logic-apps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndrewBlumhardt-1137 avatar image
0 Votes"
AndrewBlumhardt-1137 answered BrunoLucas-9843 commented

That is a cool idea. It does not appear that Adaptive Cards are part of the Office 365 connector. Though if you look at the Approval Email activity it appears to be using the same functionality. Logic Apps do support a generic HTTP request activity. It may be possible to send emails with an adaptive card using an API request. The following link may help.

https://docs.microsoft.com/en-us/outlook/actionable-messages/

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for your reply Andrew.
I will take a look at the document an try out the options provided.

0 Votes 0 ·
BrunoLucas-9843 avatar image
0 Votes"
BrunoLucas-9843 answered BrunoLucas-9843 commented

look like it is possible. This is using power automate , so big chances will work with logic apps. It uses tasks available in logic apps:

https://www.bythedevs.com/post/multi-line-approvals-with-adaptive-cards-outlook-and-power-automate

Unlike Teams task that offer an input for adaptive card, they put the adaptive card to the Compose and the compose in the send mail. try that and make sure to follow details like:

196414-image.png

the designer does have an outlook compatibility sintax

196387-image.png



image.png (37.7 KiB)
image.png (31.9 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Brunolucas,

Thanks for your reply, i see the option will work in power automate. Do you think adding the adaptive script text in email body will convert to the required format?

Im not sure why this adaptive text in outlook is not provided as an option in logical app.

Sending an adaptive card will work good in teams not in outlook.

Anyways I will give a try!

0 Votes 0 ·

I should work. here another post :
https://d365demystified.com/2020/11/23/adaptive-cards-for-outlook-actionable-messages-using-power-automate-power-platform/
give it a try, if doesn't work I can try on my end. sometimes may need to see if there is some tag or header that changes with versions

0 Votes 0 ·

Hi @Siva-2907 ,
Just checking to see if you managed to send the email with adaptive card using the compose.

Let me know if there is anything else I can help.

Regards,
Bruno

0 Votes 0 ·
MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered MayankBargali-MSFT edited

@Siva-2907 Thanks for reaching out. The workaround will be leverage compose or creating variable in your workflow and leverage the <script type="application/adaptivecard+json"> to render your adaptive cards.

For your reference I have used Compose action and output of compose action to my Send email (v2) body parameter.

 Hi  @{body('Get_user_profile_(V2)_2')?['givenName']},<br /> 
 <br />Thanks for your email. <br/>
    
 <script type="application/adaptivecard+json">
 {
     "type": "AdaptiveCard",
     "hideOriginalBody": false,
     "body": [
         {
             "type": "Container",
             "items": [
                 {
                     "type": "TextBlock",
                     "size": "Medium",
                     "weight": "Bolder",
                     "text": "Please select any of the below category\n"
                 },
                 {
                     "type": "ActionSet",
                     "actions": [
                         {
                             "type": "Action.Http",
                             "title": "Test1",
                             "url": "url"
                             "method": "POST",
                             "body": "{'messageId' : 'updatemessageid', 'selected':'kudos'}",
                             "style": "positive"
                         },
                         {
                             "type": "Action.Http",
                             "title": "Test2",
                             "url": "url",
                             "method": "POST",
                             "body": "{'messageId' : 'updatemessageid', 'selected':'culter'}",
                             "style": "positive"
                         }
                     ],
                     "horizontalAlignment": "Center"
                 }
             ]
         }
     ],
     "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
     "version": "1.4"
 }
 </script>

196335-image.png

Feel free to get back to me if you need any assistance.


image.png (32.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.