Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retirement of the SharePoint SendEmail API #3195

Closed
ndrinovsky opened this issue Jan 24, 2025 · 5 comments
Closed

Retirement of the SharePoint SendEmail API #3195

ndrinovsky opened this issue Jan 24, 2025 · 5 comments

Comments

@ndrinovsky
Copy link

What version of PnPjs library you are using

4.x

Minor Version Number

9

Target environment

All

Additional environment details

Node v18, SPFx 1.20, React V17

Question/Request

Stumbled across this blog post while debugging a SPFx application: https://devblogs.microsoft.com/microsoft365dev/retirement-of-the-sharepoint-sendemail-api/

I wasn't able to find any comments addressing this, but the _api/SP.Utilities.Utility.SendEmail is to be discontinued this October.
Will the @pnp/sp/utilities SendEmail method be retired as well, or should we default to Graph for sending emails?

@juliemturner
Copy link
Collaborator

I thought we had already marked it deprecated but apparently, we didn't... yes please start using Graph for sending emails.

@mgordic
Copy link

mgordic commented Jan 30, 2025

Hi @juliemturner ,

Could you please guide me on alternative approaches for sending emails using Microsoft Graph API?

Previously, I used SPUtility.SendEmail to send email notifications to users. However, I understand that Graph API requires either a signed-in user or Application Permissions to send emails from a technical user account with an assigned license.

Are there any other recommended alternatives for this approach? I’d appreciate any insights you can share.

Thank you in advance! 😊

@bcameron1231
Copy link
Collaborator

Hi @juliemturner ,

Could you please guide me on alternative approaches for sending emails using Microsoft Graph API?

Previously, I used SPUtility.SendEmail to send email notifications to users. However, I understand that Graph API requires either a signed-in user or Application Permissions to send emails from a technical user account with an assigned license.

Are there any other recommended alternatives for this approach? I’d appreciate any insights you can share.

Thank you in advance! 😊

Please see our docs.
https://pnp.github.io/pnpjs/graph/mail-messages/#send-message

You will need to grant the SPFx Application Permission to Microsoft Graph Mail. This can be done with the webApiPermissionRequests in your package-solution.json, or by updating it in Azure. I won't go into much detail here, but there are tons of resources online about how to set up the permissions for SPFx.

@juliemturner
Copy link
Collaborator

I'm going to close this issue as answered. If you have further issues, please feel free to create a new issue and reference this one.

Copy link

github-actions bot commented Feb 6, 2025

This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants