question

reubencovington avatar image
reubencovington asked

Granting Items to accounts matching email

We are looking to grant items to accounts whose email matches an online database of users who have subscribed to a website. Is there an easy way we can check against a list of emails and if they already have the item?

Account ManagementIn-Game Economy
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

>> check against a list of emails

I am not sure which email you are asking, but to get the player’s PlayFab Login Email or Contact Email, you may use GetPlayerProfile API, with additional ProfileConstraints property, defined in the request, for example:

{
  "PlayFabId": "xxxxxxx",
  "ProfileConstraints":{
    "ShowLinkedAccounts":true,
    "ShowContactEmailAddresses": true
  }
}

Meanwhile, PlayFab supports to create a scheduled task to check emails for all players, via selecting “Run actions on each Player in a segment” and select “ALL Players” segment. You may create a Cloud Script function or Azure function to call GetPlayerProfile API to retrieve player’s email address.

In addition, in terms of external database, I am not sure how you will to retrieve those data, but Cloud Script doesn’t support importing 3rd party module but it should work via HTTP request.

>> if they already have the item?

You may simply store a flag variable in Player Read-Only/Internal Data as a mark.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.