Expand my Community achievements bar.

SOLVED

How to get workflow approval via email in AEM?

Avatar

Level 9
I am developing a workflow where authors or admins will need to approve it via email. Our goal is to have both regular AEM approval (via the Inbox console) and to send an email notification along with an approval option.
 
We have created an email service to send emails to users and are planning to create a link for approval requests. I am thinking about creating a servlet that will handle the request, but I am still wondering how the AEM author login will work? Without logging into the AEM author, I guess there is no way to approve workflow via email. Could you please clarify my understanding? Is there any way to manage this use case?
1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @Mario248 

 

There is no direct way to do this, however we can brainstorm on the options available. If the workflow is to be approved outside AEM, we can explore Rest HTTP API for Workflows, just like we have for Assets HTTP API
Please find few curl commands below:

https://experienceleague.adobe.com/docs/experience-manager-65/developing/extending-aem/extending-wor...

 

View solution in original post

5 Replies

Avatar

Level 7

Hi @Mario248 ,
Yes, you got the approach, you can create a custom servlet to handle the action and authenticate the user. You can use the AEM Oauth2 framework to authenticate the user and then use the Workflow Session API to approve the workflow, 

 

So, in our case once the user has approved the workflow, you can send a confirmation email to the user to let them know the workflow has been approved

Avatar

Level 9

Could you please clarify two things?

1) How to authenticate the user ? User just clink the link on the email and we dont have password for them ? Is there any api to authenticate ?

 

2) How to approve the workflow ? Can you tell me what API should be used to approve the workflow ?

Avatar

Correct answer by
Employee Advisor

Hi @Mario248 

 

There is no direct way to do this, however we can brainstorm on the options available. If the workflow is to be approved outside AEM, we can explore Rest HTTP API for Workflows, just like we have for Assets HTTP API
Please find few curl commands below:

https://experienceleague.adobe.com/docs/experience-manager-65/developing/extending-aem/extending-wor...

 

Avatar

Community Advisor

Hi @Mario248 

 

You can use service credentials to securely authenticate to AEMAEM’s Developer Console grants access to Service Credentials, which are used to facilitate external applications, systems and services to programmatically interact with AEM Author or Publish services over HTTP.

 

https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/a... 

 

I would suggest you to keep the things simple and use AEM Inbox & email notifications and allow the approvers to login to AEM to approve or reject the request.  

 

https://experienceleague.adobe.com/docs/experience-manager-65/administering/operations/notification.... 

 

Hope this helps.