Friday 30 August 2024

How to generate Originator for outlook actionable message adaptive card?

Recently I was working on Power Automate flow to notify users. We generally use HTML template to send the notification. This time I thought to implement something different and tried to create Adaptive card to send notification. You can generate sample adaptive card using below site:

It is json code that will be rendered in design way by Microsoft apps (like teams, Outlook etc.).

Note – This will not work with other cloud emails like Gmail. 

Issue:

When I tried it for my user, it worked well. But when I send the email to a colleague, to see how it renders on their end, it was not showing. The Emails are showcasing blank card. The same code was working for teams. It was rendered correctly.

Analysis:

When I searched for the issue on web, I found out that when we use adaptive card with Outlook, it requires special header called Originator. This header is not required in the Teams message. So, now the question was how to generate Originator?

Solution:

We need to follow below steps to generate Originator:

  1. Go to below link:
    URL - https://outlook.office.com/connectors/oam/publish
  2. Click New Provider.

  3. This will open form to fill details. 
    • New Provider
      • Friendly Name – Provide name for your connection.
      • Provider ID (Originator) – Copy this ID. We will need this for sending the outlook adaptive card.
      • Sender Email Address – Provide email address from which the adaptive card will be sent. 
      • Target URLs – Provide URL where the response will be received. Please set up using Power Automate or any API which will process the response. 
      • Public Key (Optional) – Provide RSA key for encryption.
      • Logo (Optional) – Provide logo for your card request. 
            

    • Scope of Submission – This has 3 different values and based on selection there will be additional information will be asked.
      • Test Users – Select this if you are testing the functionality and want to send the card for review to specific users. Once selected You will see textbox below to provide test user email address with “;” (semicolon) separated.

        This is auto approved.  


      • Organization – If your card is ready and want to publish this functionality for your organization, select this option. Once selected, you will need to provide additional email who will be notified and comment why you are setting this up.

        This will send the notification to your exchange admin for approval and after approval it will take approx. 24 hours to rollout the changes.

        Outlook admin can approve the request on below link: https://outlook.office.com/connectors/oam/admin

        We will set up this in this blog. 


      • Global – If you want the functionality to be deployed over multiple tenants or want to make it publicly available, please select this option. Once selected, you need to provide your contact information, your company details, scenario for your adaptive card, your adaptive card code and screenshots of your cards and its option.

        This will be sent to Microsoft for approval, and it will take approx. 2 weeks for rollout after Microsoft approves your request. 

    • Accept the terms and condition. 
    • Click save.

As mentioned earlier, we are setting up this for organization. So, I have selected second option and saved the changes. It then submits the request on the page and you will see pending request status.


Now, we need to ask the exchange admin to review the request and approve it.
URL - https://outlook.office.com/connectors/oam/admin

  1. When you open this, you can see all the pending approvals.


  2. Click on Provider.
  3. It will open the submitted request with approve & reject button.


  4. Click approve and provide any additional comment if you needed. 



  5. After this you can use the Provider ID (Originator) that we have copied in the step 3 while creating the Provider.


In the next blog we will see how to send the adaptive card with outlook and power automate and where to use the Originator. 

Reference: 

  1. https://learn.microsoft.com/en-us/outlook/actionable-messages/adaptive-card#outlook-specific-adaptive-card-properties-and-features
  2. https://poszytek.eu/en/microsoft-en/office-365-en/powerautomate-en/adaptive-cards-in-outlook-ultimate-guide/