send email

vnext
Paul Schneider 8 years ago
parent 57a6ecb654
commit ebfad459fb
1 changed files with 16 additions and 13 deletions

@ -81,9 +81,9 @@ namespace Yavsc.Controllers
var yaev = command.CreateEvent(_localizer); var yaev = command.CreateEvent(_localizer);
MessageWithPayloadResponse grep = null; MessageWithPayloadResponse grep = null;
if (pro.AcceptNotifications if (pro.AcceptPublicContact)
&& pro.AcceptPublicContact)
{ {
if (pro.AcceptNotifications) {
if (pro.Performer.Devices.Count > 0) { if (pro.Performer.Devices.Count > 0) {
var regids = command.PerformerProfile.Performer var regids = command.PerformerProfile.Performer
.Devices.Select(d => d.GCMRegistrationId); .Devices.Select(d => d.GCMRegistrationId);
@ -95,6 +95,7 @@ namespace Yavsc.Controllers
ViewBag.GooglePayload=grep; ViewBag.GooglePayload=grep;
if (grep!=null) if (grep!=null)
_logger.LogWarning($"Performer: {command.PerformerProfile.Performer.UserName} success: {grep.success} failure: {grep.failure}"); _logger.LogWarning($"Performer: {command.PerformerProfile.Performer.UserName} success: {grep.success} failure: {grep.failure}");
}
await _emailSender.SendEmailAsync( await _emailSender.SendEmailAsync(
_siteSettings, _smtpSettings, _siteSettings, _smtpSettings,
@ -103,6 +104,9 @@ namespace Yavsc.Controllers
$"{yaev.Message}\r\n-- \r\n{yaev.Previsional}\r\n{yaev.EventDate}\r\n" $"{yaev.Message}\r\n-- \r\n{yaev.Previsional}\r\n{yaev.EventDate}\r\n"
); );
} }
else {
// TODO if (AcceptProContact) try & find a bookmaker to send him this query
}
ViewBag.Activity = _context.Activities.FirstOrDefault(a=>a.Code == command.ActivityCode); ViewBag.Activity = _context.Activities.FirstOrDefault(a=>a.Code == command.ActivityCode);
ViewBag.GoogleSettings = _googleSettings; ViewBag.GoogleSettings = _googleSettings;
return View("CommandConfirmation",command); return View("CommandConfirmation",command);
@ -110,7 +114,6 @@ namespace Yavsc.Controllers
ViewBag.Activity = _context.Activities.FirstOrDefault(a=>a.Code == command.ActivityCode); ViewBag.Activity = _context.Activities.FirstOrDefault(a=>a.Code == command.ActivityCode);
ViewBag.GoogleSettings = _googleSettings; ViewBag.GoogleSettings = _googleSettings;
return View(command); return View(command);
} }
public ActionResult HairCut(string performerId, string activityCode) public ActionResult HairCut(string performerId, string activityCode)

Loading…