Hi AllI am sending a request email to an approver with "Accept" and "Reject" buttons. After the email is sent, the approver can click either the "Accept" or "Reject" button. Without redirecting to the OutSystems application, the status and the details of the person who clicked the button (two values: status and username) should be updated in OutSystems.
Note: I need to capture the status and the details of the person who clicks the button.
Hi @Anantharaman P
1.Create a REST API with an endpoint like /api/approval/update.with Input Parameters:
a.RequestId (Identifier for the request)
b.Status (Accepted/Rejected)
c.Username (Approver’s email or username)
Logic: Inside the REST API, update the corresponding record in the database with the received Status and Username.
2. Design the Email Template
In the email body, include two buttons: Accept and Reject. These buttons will trigger the REST API via a simple GET request.
EMail content:
<a href ="api update">Accept
<a href="api update'>Reject
Replace {ApproverEmail} with the actual email of the approver when generating the email content.
RequestId helps in identifying which request is being approved/rejected.
Hi @Karnika-EONE Here, Whether I can be able to get the User Detail (the person who clicks the button).Thanks.
For direct links (basically a GET request to a resource), you may consider the following approach to make it secure.
* When generating the approve, decline links first generate A JWT with claims identifying the user.
* Sign and base64 encode the JWT and append it as query string parameter to the request like .../approve?token=<base64 encoded header, token, signature>.
In the backend receiving the request.
* Validate the signature of the token
* Get the user id from the claims of the token
Stefan
Hi @Karnika-EONEThank you for your prompt responseIf possible, can you please share sample oml file.
It is not a straight forward solution or any direct component available.
There is a forge component which you can check out.
https://www.outsystems.com/forge/component-overview/16607/actionable-message-sample-o11
https://itnext.io/send-actionable-messages-from-outsystems-applications-7073cec90618
But due to security reasons some email client might not allow this.
Please see my tutorial on Actionable Messages with OutSystems https://without.systems/send-actionable-messages-from-outsystems-applications
Hi @Stefan Weber I have already tried the solution provided in the link and it worked well. However, since I'm using a personal account, I'm unable to create a shared mailbox in Microsoft. Therefore, I am looking for a different approach. Thank you.
Yes. actionable emails are only possible within a Microsoft Outlook environment. The shared mailbox in the article is just an example, because it is easier to akquire credentials for a shared mailbox. However the same approach is possible using user credentials and sending directly from a user. But if you only have a personal account this approach most likely is not suitable for you.
Thank you.
Hi @Stefan WeberUsing the provided link, I need to know if the following cases are possible:
Case 1: Is it feasible to update the system's status when a user clicks any button within the email, without redirecting or navigating to another page?Case 2: I need the information of the person who clicks the button. For example, if I receive an approval email and forward it to my team member for approval, when they click the approve button, will it capture my information or my team member's information?
Which information are you referring to? My article on Actionable Messages in Outlook or the above one to use an encoded JWT as part of the url?
Hi @Stefan WeberArticle - Actionable Messages in Outlook
For Case 1: That is the overall feature of Actionable Messages in Outlook. The user does not leave Outlook at all. He takes an action (and even text input) directly in his inbox and submits. Then the actionable message updates in the user inbox and displays the submitted values, which is great if a user later looks up the message to see how he decided on a request.
For Case 2: See the section Authenticating Outlook user in the article. If someone forwards a message to another user and that user clicks on a button in the actionable message it is actually his credentials that are sent to the backend. The Authorization header is not part of the email but rather added to the request when a user clicks a button.
Hi @Stefan Weber Let me try with your Solution.Thank You
Hi @Stefan WeberI am Implementing Actionable message by following the link you are provided.Here In the below image That I need to register which application whether the application I created in outsystems or application I created in Azure portal.
Thank you. I updated the article, here ist the link to the Provider registration page https://outlook.office.com/connectors/oam/publish
Hi @Stefan Weber
In Case 2: Whether it is possible to get the user information while clicking the button directly. To achieve it what parameter I need to send it in Adaptive Card JSON.If Possible, please elaborate step by step that who can we get the user information by clicking the button.Thanks
Hi, you will find all informations in the article or the linked article on how to protect REST APis which shows how to get the Authorization header and validate it. You can also download the sample application from Forge, also linked in article. I guess that is much more than step-by-step :-)
Hi @Stefan WeberAfter creating a shared mailbox in Microsoft 365, do we need to configure the same shared email address in OutSystems under Administration > SMTP Configuration? If yes, where can we find the SMTP server and port number?
Hi @Stefan WeberSMTP Server: smtp.office365.com Is it fine if we use common SMTP Server and port number like Port 587, Port 465 and Port 25.Or else we have to get these above details while creating shared mailbox.Thanks
Hi, see the Graph_SendMail action in the demo application. In an M365 environment you shouldn't send via smtp (I believe the smtp feature of office365 is already deprecated) but via Graph API. So no, you do not need to configure SMTP details on platform level.
Thank you
Hi @Stefan WeberI have different idea guide me If I am wrong.
Case 1: Sending Adaptive Card JSON Content via SMTP
I have configured SMTP for M65 and can send emails successfully. Is it possible to include Adaptive Card JSON content in the body of an email sent via SMTP?
Case 2: Capturing User Actions (Approve/Reject) via SMTP
If it is possible to include Adaptive Card JSON content in the email body, can we capture the user’s response (approve or reject) after they click the button in the email If we sent via the SMTP portal?Thanks Ananth
Hi Anatharaman,
To capture the status and approver details when they click "Accept" or "Reject" in the email, follow these steps:
Email Generation: Include "Accept" and "Reject" buttons in the email, with URLs containing the status and username parameters (e.g., https://yourapp.outsystemscloud.com/ProcessApproval?status=Accept&username={username}).
Web Screen to Capture Parameters: Create a Web Screen to capture the status and username parameters from the URL.
Update Status: Use a Server Action to update the approval status and username in the OutSystems database.
Optional Confirmation: Optionally, show a confirmation message or redirect the user after processing the action.
This way, the approver’s choice will be captured in OutSystems without redirecting them to the application.
Best regards,Mukesh Kumar S.