Current Situation
I have a document library that uses the Classic experience. This is necessary because the page includes a custom webpart that displays buttons based on the current user’s permissions and the document status (stored in a custom column). One or two buttons may be displayed next to each file (buttons are not shown for folders) and a button may be displayed just below the folder contents. If the user is at the top level of the library, a warning message is displayed: “Don’t store files at the top level.”
Clicking the button displayed below the folder contents displays a modal dialog box. The dialog box includes a textarea and two buttons: “Send Email” and “Cancel”. Clicking the button labeled “Send Email” would send an email to the programmatically determined recipients with a link to the folder the user was browsing when they clicked the “Send Email” button. Clicking the button labeled “Cancel” would dismiss the modal without further action.
Current Issue
The code is using the SharePoint SendMail REST API endpoint to send the email. That endpoint now returns an error with a note prompting the developer to use the Graph API instead. The emails are not being sent anymore.
Potential Solutions
I have set up custom formatting to display the buttons for each row when I switch the library to use the Modern experience. I have also developed a SharePoint Framework webpart that, when shown on the same page with the library webpart, controls the visibility of those buttons based on the current user’s group membership.
I am investigating two paths forward but have hit a wall in both directions.
- I would like to show the custom webpart at the top of the default library view, but I cannot find a way to do that. This would allow me to deploy the custom webpart as is.
- I am open to building a modern page that includes the custom webpart and the library webpart, but I don’t know how to specify a deep link to that page such that the library webpart would automatically navigate to the provided path.