Game ideas & features

Your next feature

Email Sending

Send an email to a player using an existing template.

Requires a player session
Godot
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 run_reviewed_action() from an explicit button or scene action. Opening the file alone sends no request.

GDScript
res://scripts/email_sending.gd
horizOn call
1extends Node
2​
3# Existing configured SDK and authenticated player session required.
4# Invoke run_reviewed_action explicitly after reviewing this example.
5func run_reviewed_action() -> void:
6 if not Horizon.auth.isSignedIn():
7 return
8 # Send a transactional email to a registered app user
9 var result = await Horizon.email_sending.send_email(
10 Horizon.auth.getCurrentUser().userId,
11 "welcome",
12 {"username": "PlayerOne"},
13 "en"
14 )
15​
16 if result.is_empty():
17 push_error("Email could not be queued. Check the template and recipient.")
18 return
19​
20 # Check the delivery status later
21 var status = await Horizon.email_sending.get_email_status(result.get("id", ""))
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
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.