question

fatih avatar image
fatih asked

Populate Contact Email field with Account Emails,Populate contact email field with account email address

Hey all, we have a few hundred users that where not successfully linked with a contact email on their account. Is there a task or script i can run to copy the account mail into the contact mail?

,

We have a few hundred users that registered before we fixed the way accounts where created and linked. This leaves me with lots of users that have their contact field empty.

Is there any way i can run a task/script that takes their email from the account field and adds it to the contact field?

Account Management
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

·
pfnathan avatar image
pfnathan answered

Please take a look at the following link for your inquiry:

Reference: https://api.playfab.com/docs/tutorials/landing-players/using-email-templates-to-send-an-account-recovery-email

It looks like you cannot find the "Contact email" card like in Step 2.

Here is an example which shows how: https://developer.playfab.com/en-us/D20C/players/9922B14419E7940E/overview

Please, scroll down to "Contact email" card and try by issuing the following calls:

1.) Login

2.) GetPlayerProfile

3.) If PlayProfile does not have contact email filled in, make a call to AddOrUpdateContactEmail asking the player for email input

7 comments
10 |1200

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

fatih avatar image fatih commented ·

thank you so much for the answer.

I implemented that in our app, so in future everybody that logs in will be updated.

Do you think there is a way to connect with the people that may not return anytime soon? Sending email tasks only work with accounts that have a contact mail. Seems like I can’t send anything to their login mail.

That’s why I was asking if there is any automation that copies that to the contact field

0 Likes 0 ·
brendan avatar image brendan ♦♦ fatih commented ·

Since you mentioned in a separate thread that you would even be interested in a way to get the set of player accounts in order to manually update them in the Game Manager, you could potentially do that. First, use a one-time Scheduled Task that puts a Tag on players that have an email login (GetUserAccountInfo) but don't have a Contact Email (GetPlayerProfile), then make a Segment that contains only those players, and finally use the Admin API to query for that Segment.

0 Likes 0 ·
fatih avatar image fatih brendan ♦♦ commented ·

Hey Brendan, thanks for the reply. Just for claification: You are not talking about the scheduled task that i can set up in the game manager? Because there is no filter methods available. I can only choose a segment and tag players. And i cant make a segment because there are no filters for contact email and so forth.

I imagine you were talking about small cloudscript functions? Would you have a little example? The available examples never read values out of user accounts or player profiles.
Thanks!

0 Likes 0 ·
Show more comments
pfnathan avatar image pfnathan ♦ commented ·

We do have a migration script which we can run on the whole title for customers, but this service is only available to Enterprise tiers

0 Likes 0 ·
fatih avatar image fatih commented ·

Hey pfnathan! Neither Get Player Profile, or Get Player Account returns any info on wether or not the user has a contact email!

Profile:

PublisherId
TitleId
PlayerId
DisplayName

Account:

PlayFabId
Created
Username
TitleInfo
PrivateInfo

any ideas?

0 Likes 0 ·
brendan avatar image brendan ♦♦ fatih commented ·

Server/GetUserAccountInfo returns the account email address in PrivateInfo. Server/GetPlayerProfile returns the contact email address if you set ShowContactEmailAddresses to true in the ProfileConstraints.

0 Likes 0 ·

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.