Exemplo n.º 1
0
        public static string Send(string subject, string[] msgTo, string html, ElasticEmail email)
        {
            ApiKey = email.APIKey;

            var task = SendEmail(subject, email.Email, email.FromName, msgTo, html, html);

            task.ContinueWith(t =>
            {
                if (t.Result == null)
                {
                    Console.WriteLine("Something went wrong. Check the logs.");
                }
                else
                {
                    Console.WriteLine("MsgID to store locally: " + t.Result.MessageID); // Available only if sent to a single recipient
                    Console.WriteLine("TransactionID to store locally: " + t.Result.TransactionID);
                }
            });
            task.Wait();
            if (task.Result != null)
            {
                return(task.Result.TransactionID);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
    public IEnumerator SendReport(string body)
    {
        var subject = "SCENARIO ISSUE";
        var bodyWithScenarioHistory = "";

        if (_incidentManager.NextIncident.Count > 0)
        {
            var currentIncident = _incidentManager.NextIncident[0];

            bodyWithScenarioHistory = ScenarioTracker.GetScenarioHistory(body, currentIncident.Scenario.Id,
                                                                         currentIncident.IncidentContent.Title, Location.CurrentLocation,
                                                                         (DeviceLocation.shouldOverrideLanguage ? DeviceLocation.overrideLanguage.ToString() : "English"));
        }
        else
        {
            bodyWithScenarioHistory = ScenarioTracker.GetScenarioHistory(body, "", "", "", "");
        }

        var www = new WWW(ElasticEmail.GetAddress(), ElasticEmail.GetForm(subject, bodyWithScenarioHistory));

        yield return(www);

        var message = www.error == null
            ? Localization.Get("BASIC_TEXT_SENT")
            : Localization.Get("BASIC_TEXT_ERROR");

        yield return(Loading.Stop(message, 1f));

        if (www.error == null)
        {
            FeedbackObject.gameObject.SetActive(false);
        }
    }
Exemplo n.º 3
0
    public IEnumerator SendFeedback(string body)
    {
        var subject = "FEEDBACK";

        var www = new WWW(ElasticEmail.GetAddress(), ElasticEmail.GetForm(subject, body));

        yield return(www);

        var message = www.error == null
            ? Localization.Get("BASIC_TEXT_SENT")
            : Localization.Get("BASIC_TEXT_ERROR");

        yield return(Loading.Stop(message, 1f));

        if (www.error == null)
        {
            FeedbackObject.gameObject.SetActive(false);
        }
    }