Game ideas & features

Your next feature

Email Sending

Send an email to a player using an existing template.

Requires a player session
Unity
Illustration of Email Sending
Your visible result

Email to the test player with a verified email is queued (pending). Then check delivery.

Send a transactional email3:20
Open video separately ↗

Prepare the same project

  1. Choose the same project in the dashboard as in your game configuration.

    Email Sending →
  2. Create or reuse these test entries in the dashboard form. These are example values, not current project data.

    Slug
    welcome
    Subject
    en: Welcome
    HTML Body
    en: Hello from horizOn

    Your own SMTP and an existing template are required. The recipient must be a user with verified email. An anonymous test player is insufficient.

  3. Save, reload and verify the entries before running the example. Preserve unrelated definitions.

Build this feature

You can preview the guide. Running it requires an active project key. Prepare project

SDK installed, project configuration imported and player signed in.

Your own SMTP and an existing template are required. The recipient must be a user with verified email. An anonymous test player is insufficient.

Complete the Quickstart connection with the intended player. Call RunReviewedAction() from an explicit button or scene action. Opening the file alone sends no request.

C#
Assets/Scripts/EmailSendingDemo.cs
horizOn call
1using System.Collections.Generic;
2using UnityEngine;
3using PM.horizOn.Cloud.Core;
4using PM.horizOn.Cloud.Manager;
5​
6// Existing SDK/project configuration and authenticated player session required.
7// Call RunReviewedAction explicitly after reviewing this example and its data.
8// horizOn: send an email to the player and check its status.
9public sealed class EmailSendingDemo : MonoBehaviour
10{
11 public async void RunReviewedAction()
12 {
13 var sessionUser = UserManager.Instance.CurrentUser;
14 if (sessionUser == null || !sessionUser.IsValid()) return;
15 // Send a transactional email to a registered app user
16 var response = await EmailSendingManager.Instance.SendEmail(
17 UserManager.Instance.CurrentUser.UserId,
18 "welcome",
19 new Dictionary<string, string> { ["username"] = "PlayerOne" },
20 "en"
21 );
22 if (response == null) { Debug.LogWarning("Email could not be queued. Check the template and recipient."); return; }
23​
24 // Check the delivery status later
25 var status = await EmailSendingManager.Instance.GetEmailStatus(response.id);
26 }
27}
Open the complete SDK sample ↗

Test your new feature.

Email to the test player with a verified email is queued (pending). Then check delivery.

Choose the same project in the dashboard as in your game configuration.

Endpoints
  • POST/email-sending/send
  • GET/email-sending/{emailId}
All endpoints in the API reference
Illustration of Leaderboards
Our suggestion for your next step

Give every round a high score.

Save the score after a round and show who's ahead. Keep using your connection and player session.