question

npoirier avatar image
npoirier asked

Can I use custom event properties in an email?

Hi!

I'm trying to send an email on a CustomEvent which should pass variables to the email template. So far, I've been able to make my event send the email and print certain variables, but no luck on the custom properties I sent.

Here's my custom event code :

handlers.testCustomEvent = (args, context) => {
    server.WritePlayerEvent({
        Body: {
            CustomKey: "test"
        },
        EventName : "test_custom_event",
        PlayFabId: context.playerProfile.PlayerId,
    });
}

When I see the event in the PlayStream Monitor, I see the CustomKey property in my event, but alas cannot use it in my email template when I try to do this :

$Event.CustomKey$

Is there another way to do it / a doc? So far I've seen this https://community.playfab.com/questions/20962/how-can-you-pass-data-to-custom-email-templates-wh.html which lets me think I should be able to do what I want, but it doesn't seem to work.

Thank you!
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.

Seth Du avatar image Seth Du ♦ commented ·

According to my testing result, the custom key in the Body is not supported.(even though it displays correctly in PlayStream event) However, some build-in properties in an event can be successfully retrieved. For example, $Event.EventId$ , $Event.PlayFabEnvironment.Application$ and so on.

I am thinking this is because the Body in your write player event request is a dictionary with a String key and an Object value pair ( for more information you can see PlayFab.PlayStreamModels.PlayStreamEventBase). I am not sure about how PlayFab handles the custom Object in the backend. I have informed @Brendan to see if he can help.

0 Likes 0 ·
npoirier avatar image npoirier Seth Du ♦ commented ·

Thank you! I'm looking forward to Brendan's answer.

0 Likes 0 ·
brendan avatar image
brendan answered

Sorry, but while you can use any of our pre-defined event parameters, the custom parameters in a custom event aren't supported in the $Event...$ usage model yet.

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.

Chris Kurhan avatar image Chris Kurhan commented ·

Is this still the case?

0 Likes 0 ·
Michael Kawas avatar image Michael Kawas Chris Kurhan commented ·

Hi @Brendan, I am interested in this as well. We are using Playfab to track our student's progress through our courses and achievements and so far are very excited with the possibilities. We would like to be able to automatically generate weekly progress update emails, using custom parameters to make them much more personalized.

However, without the custom parameters, the pre-defined event parameters are pretty limiting for this purpose.

Furthermore, is there a way to generate more polished looking emails with badge images, etc? Having generated a few email templates now, it seems to be pretty bare bones.

We have been investigating the Segment Add-on -> Mailchimp route, but not sure yet if we can get the same custom properties out to Segment either.

In summary, is there any update or ETA on this? I didn't see it in a roadmap. Any other suggestion(s) for this process are appreciated.

0 Likes 0 ·
pacedu avatar image
pacedu answered

hey, I need help in this on urgent basis I have to show my data in mail how can I??

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.