pnp/pnpcore

Cant receive the invitation mail

Opened this issue · 4 comments

Category

  • Bug

Describe the bug

I am attempting to share a document file with a user using the invitation method CreateSharingInviteAsync.

I executed the code as shown below, and it ran without any errors. I also verified that the document has granted read permissions to the user. However, the user did not receive the invitation email, despite setting SendInvitation= True.

image

here is my application permission
image

here is my sharing settings
image

Expected behavior

An invitation email should sent out to the user

Environment details (development & target environment)

DELETE THIS LINE BEFORE SUBMITTING - Complete the following (if ignored you'll be prompted for it before we can address your issue... save the time and provide it in your initial submission).

  • SDK version: PnP.Core.Admin 1.14.0 , PnP.Core.Auth 1.14.0
  • OS: Windows 11
  • SDK used in: Console App
  • Framework: .Net 8.0
  • Tooling: Visual Studio 2022

Thanks for your contribution! Sharing is caring.

@ZiLin3 : I've just tested this myself by making the Graph call outside of PnP Core SDK (https://learn.microsoft.com/en-us/graph/api/driveitem-invite?view=graph-rest-1.0&tabs=http) and I'm also not seeing a mail arriving. There's however an Exchange incident reported for my test tenant, that might impact this. Can you cross check that if you make the actual graph AAPI call things work for you?

Request:

> POST https://graph.microsoft.com/v1.0/sites/bertonline.sharepoint.com,7865418d-ba88-4b6d-80d2-aa13513fa1b1,0e8eaaa8-cea6-464e-8d5b-b1d0c1df3778/drives/b!jUFFFIi6bUuA0qoTUT-hsaiqjg6mzk5GjVux0MHfN3gdGKqOmz06Q6volw1KRMzD/items/01YO2ARP89HHM7KLPWWBBKDOUDVZZTDOLY/invite
> Authorization: Bearer eyJ0eXAiO....
> content-type: application/json
> data
{
  "requireSignIn": true,
  "sendInvitation": true,
  "roles": [
    "Read"
  ],
  "recipients": [
    {
      "email": "Anna@bertonline.onmicrosoft.com"
    }
  ],
  "message": "I\u0027d like to share this file with you"
}

Response

< 200 OK
< cache-control: no-store, no-cache
< transfer-encoding: chunked
< content-type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
< location: https://graph.microsoft.com
< vary: Accept-Encoding
< strict-transport-security: max-age=31536000
< request-id: 203df578-04d3-4704-88ff-e583847c1660
< client-request-id: 203df578-04d3-4704-88ff-e583847c1660
< x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"AM1PEPF000105AE"}}
< link: <https://developer.microsoft-tst.com/en-us/graph/changes?$filterby=v1.0,Removal&from=2021-09-01&to=2021-10-01>;rel="deprecation";type="text/html", <https://developer.microsoft-tst.com/en-us/graph/changes?$filterby=v1.0,Removal&from=2021-09-01&to=2021-10-01>;rel="deprecation";type="text/html"
< deprecation: Fri, 03 Sep 2021 23:59:59 GMT
< sunset: Sun, 01 Oct 2023 23:59:59 GMT
< odata-version: 4.0
< date: Mon, 25 Nov 2024 09:29:56 GMT
nel0 commented

We're experiencing the same issue as @ZiLin3. Our code that uses PnP to share succeeds but no mails are sent out.

@jansenbe - I tried calling the Graph API directly and it also succeeds. But no mails are sent.
image

I tested using Graph API, it succeeds, but no receive any invitation. Result same as @nel0 .

@nel0 / @ZiLin3 : this is a platform issue. I would recommend that you (or your customers) open a support ticket explaining that the Graph call (show the raw API call not working from Graph Explorer or PostMan) is not triggering mail sending. From the PnP Core SDK side there's not much we can do, this feature used to work previously, so clearly something changed at the platform side.