你的下一项功能
邮件发送
使用现有模板向玩家发送邮件。
Unity

可见的结果
发给邮箱已验证的测试玩家的邮件进入队列(pending)。然后检查投递结果。
发送事务性邮件3:20
此教程以英语播放。
单独打开视频 ↗准备同一个项目
在仪表盘中选择与游戏配置相同的项目。
邮件发送 →在控制台表单中创建或复用这些测试条目。这些是示例值,并非项目当前数据。
- 标识符
welcome- 主题
en: Welcome- HTML正文
en: Hello from horizOn
需要自有 SMTP 和现有模板。收件人必须是邮箱已验证的用户。匿名测试玩家无法满足要求。
运行示例前先保存、重新加载并核对条目。保留其他定义。
实现此功能
你可以预览指南。运行需要有效的项目密钥。 准备项目
已安装 SDK、导入项目配置,且玩家已登录。
需要自有 SMTP 和现有模板。收件人必须是邮箱已验证的用户。匿名测试玩家无法满足要求。
先通过快速入门连接目标玩家,再通过明确的按钮或场景操作调用RunReviewedAction()。仅打开文件不会发送请求。
C#
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:向玩家发送邮件并查看其状态。
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}
测试你的新功能。
发给邮箱已验证的测试玩家的邮件进入队列(pending)。然后检查投递结果。
在仪表盘中选择与游戏配置相同的项目。


