I'm trying to send an approval email with user information, so I can accept or reject a new user.
I have set a button (OnSelect property) to patch user information to a SharePoint list, and also send an email by using following code. The email is sent and the informations added to SP list when I push the button, but I don't know how to set the options (on the buttons which appear inside the email) to change the status in SharePoint.
Office365Outlook.SendMailWithOptions(
"https://www.google.com",
{
To: LookUp('UsersList', UserType = 2, Email),
Subject: "ACCESS REQUEST",
HeaderText:"",
SelectionText:"Select one option to approve or reject the access request.",
Options: "APPROVE, REJECT",
Importance:"Low",
Attachments:Blank(),
UseOnlyHTMLMessage:true,
HideHTMLMessage:true,
ShowHTMLConfirmationDialog:false,
Body:
"<b> User Name: </b>" & varUserName
& "<p> </p>" &
"<b> Job Title: </b>" & varJobTitle
& "<p> </p>" &
"<b> Email: </b>" & varEmail
& "<p> </p>" &
"<b> User Type: </b>" & varUserType
& "<p> </p>" &
"<b> Date: </b>" & varDate
& "<p> </p>" &
"<b> Manager: </b>" & varManager
}
)
I have seen that Office365Outlook.SendMailWithOptions probably doesn't work. So, is there a way to do that using Power Automate?
I don't how to set the "To:" option in Power Automate the same way I'm doing here, with a dynamic list which can contain more than one approver email:
To: LookUp('UsersList', UserType = 2, Email)