diff --git a/Yavsc/Controllers/CommandController.cs b/Yavsc/Controllers/CommandController.cs index 7e926124..3a1e5883 100644 --- a/Yavsc/Controllers/CommandController.cs +++ b/Yavsc/Controllers/CommandController.cs @@ -152,12 +152,16 @@ namespace Yavsc.Controllers var regids = command.PerformerProfile.Performer .Devices.Select(d => d.GCMRegistrationId); var sregids = string.Join(",",regids); - _logger.LogWarning($"ApiKey: {_googleSettings.ApiKey} {sregids}"); + _logger.LogWarning($"ApiKey: {_googleSettings.ApiKey}"); + _logger.LogWarning($"RegIds: {sregids}"); grep = await _GCMSender.NotifyAsync(_googleSettings,regids,yaev); } // TODO setup a profile choice to allow notifications // both on mailbox and mobile // if (grep==null || grep.success<=0 || grep.failure>0) + ViewBag.GooglePayload=grep; + if (grep!=null) + _logger.LogWarning($"Performer: {command.PerformerProfile.Performer.UserName} success: {grep.success} failure: {grep.failure}"); await _emailSender.SendEmailAsync( _siteSettings, _smtpSettings, @@ -166,7 +170,8 @@ namespace Yavsc.Controllers $"{yaev.Description}\r\n-- \r\n{yaev.Comment}\r\n" ); } - return RedirectToAction("Index"); + ViewBag.GoogleSettings = _googleSettings; + return View("CommandConfirmation",command); } ViewBag.GoogleSettings = _googleSettings; return View(command); diff --git a/Yavsc/Views/Command/CommandConfirmation.cshtml b/Yavsc/Views/Command/CommandConfirmation.cshtml new file mode 100644 index 00000000..894ec51c --- /dev/null +++ b/Yavsc/Views/Command/CommandConfirmation.cshtml @@ -0,0 +1,66 @@ +@model BookQuery +@using Yavsc.Models.Google.Messaging +@{ + ViewData["Title"] = SR["Book "+Model.PerformerProfile.ActivityCode]; +} +@section header{ + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } + + + + +} +@section scripts{ + +} +

@ViewData["Title"]

+
+

@SR["Your book query"]

+
+ @Html.DisplayFor(m => m.EventDate) + @Html.DisplayFor(m => m.Location) +

@SR["Notifications sent to its devices"]

+
+ @if (ViewBag.GooglePayload !=null) + { + + @if (ViewBag.GooglePayload.results !=null) { + @:success: @ViewBag.GooglePayload.success + @:failure: @ViewBag.GooglePayload.failure +
+ + @foreach (MessageWithPayloadResponse.Result mr in ViewBag.GooglePayload.results) { + @:message_id: @mr.message_id + @:registration_id: @mr.registration_id + @:error: @mr.error +
+ } + } + } +
+ +