question

bodin avatar image
bodin asked

Cannot use $Profile.Locations$ and others in Email Template

Hi,

I'm testing html tag below in Email body.

<html>
<img src="$Profile.AvatarUrl$" alt="Player image">
Image URL: $Profile.AvatarUrl$<br>
Player ID: $Profile.PlayerId$<br>
Player Name: $Profile.DisplayName$<br>
Player Origination: $Profile.Origination$<br>
Linked Accounts: $Profile.LinkedAccounts$<br>
Logged in from: $Profile.Locations$<br>
</html>

however, the email I recevied doesn't show all the infomation.

Image URL: 
Player ID: XXXXXXXXXXXXXXX
Player Name: Bodin Amorn
Player Origination: Facebook
Linked Accounts: PlayFab.PlayStream.Profile.PlayerLinkedAccount
Logged in from: LastLogin

as you can see,

- $Profile.LinkedAccounts$ not showing the information

- $Profile.Locations$ only shows "LastLogin" text

Could you please let me know if I done anything wrong?

Thanks in advance & Best regards,

Bodin

apis
10 |1200

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

Hernando avatar image
Hernando answered

About available fields in the email template, there is a thread with a detail reply from Andy: https://community.playfab.com/questions/26786/can-i-pre-populate-email-template-with-playfab-log.html?childToView=26853#comment-26853

(For some invalid links, please refer to here:

https://docs.microsoft.com/en-us/rest/api/playfab/server/account-management/getplayerprofile?view=playfab-rest#playerprofilemodel

https://docs.microsoft.com/en-us/gaming/playfab/api-references/events/player-ranked-on-leaderboard-version)

As for AvatarUrl, it should work fine, please make sure that the player you tested has set this property.


img-2972.jpg (141.7 KiB)
10 |1200

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

bodin avatar image
bodin answered

Hi @Hernando

Thank you for your reply.

from your link, I saw LocationModel[] contains CountryCode & City Name. Is there any example how to get this info from $Profile.Locations$ ?

2 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.

renhe avatar image renhe commented ·

Only primitive data type can work the way in an email template, and Profile.Locations is an Array, it can't be used in the template.

0 Likes 0 ·
bodin avatar image bodin renhe commented ·

I got it now. thank you very much for info.

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.