GSM Sendy
Dùng để thu thập email của user, phục vụ marketing
1. Subscribe
Dùng để user đăng ký 1 email và nhận một mã giftcode về mail.
Sau khi user nhập mã giftcode vào game, thì sẽ nhận được phần thưởng và hệ thống sẽ lưu trữ mail của user để thu thập data.
void Subscribe(string email, string name, Dictionary<string, string> customFields = null, Action onSuccess = null, Action<long, string> onFail = null)
Các tham số
email
(Required): Là email để đăng ký.name
(Optional): Là tên của user nếu có.customFields
(Optional): Là các trường tùy biến, phục vụ để chèn vào nội dung trong mailonSuccess
Optional): Hàm được thực hiện khi thành công.onFail
Optional): Hàm được thực khiện khi có lỗi xảy ra.
Code mẫu:
GSMSendy.Subscribe("[email protected]", "tuyen", new Dictionary<string, string>() { { "giftcode", "SUB2023" } }, () =>
{
Debug.Log("Subscribe Success");
}, (statusCode,error) =>
{
if(statusCode==(long)StatusCode.Maintain)
{
//Xử lý khi có thông báo bảo trì
}
Debug.Log("Subscribe fail" + error);
});
2. UnSubscribe
Dùng để hủy đăng ký nhận các email marketing
void UnSubscribe(string email, Action onSuccess = null, Action<long, string> onFail = null)
Các tham số
email
(Required): Là email để hủy đăng ký.onSuccess
Optional): Hàm được thực hiện khi thành công.onFail
Optional): Hàm được thực khiện khi có lỗi xảy ra.
Code mẫu:
GSMSendy.UnSubscribe("[email protected]", () =>
{
Debug.Log("Unsubscribe Success");
}, (statusCode, error) =>
{
if (statusCode == (long)StatusCode.Maintain)
{
//Xử lý khi có thông báo bảo trì
}
Debug.Log("Unsubscribe fail" + error);
});
3. Delete Subscribe
Dùng để xóa bỏ thông tin email ra khỏi hệ thống
void Delete(string email, Action onSuccess = null, Action<long, string> onFail = null)
Các tham số
email
(Required): Là email muốn xóa thông tin.onSuccess
Optional): Hàm được thực hiện khi thành công.onFail
Optional): Hàm được thực khiện khi có lỗi xảy ra.
Code mẫu:
GSMSendy.Delete("[email protected]", () =>
{
Debug.Log("Delete Success ");
}, (statusCode, error) =>
{
if (statusCode == (long)StatusCode.Maintain)
{
//Xử lý khi có thông báo bảo trì
}
Debug.Log("Delete fail" + error);
});
4. Check Status
Dùng để kiểm tra trạng thái 1 email đã subscribe hoặc unsubscribe với hệ thống
void CheckSubscribeStatus(string email, Action<SendySubscribedStatus> onComplete = null, Action<long, string> onFail = null)
Các tham số
email
(Required): Là email muốn xóa thông tin.onComplete
(Optional): Hàm được thực hiện khi thành công.onFail
Optional): Hàm được thực khiện khi có lỗi xảy ra.
Code mẫu:
GSMSendy.CheckSubscribeStatus("[email protected]", status =>
{
Debug.Log("Status " + status.ToString());
}, (statusCode, error) =>
{
if (statusCode == (long)StatusCode.Maintain)
{
//Xử lý khi có thông báo bảo trì
}
Debug.Log("CheckSubscribeStatus fail" + error);
});
Last updated