remove Google validation of the adress, and give email sending status

This commit is contained in:
2018-11-19 17:39:03 +01:00
parent 95c093d942
commit 1574fcc2b2
4 changed files with 47 additions and 108 deletions

View File

@ -169,23 +169,38 @@ namespace Yavsc.Controllers
if (pro.AcceptNotifications
&& pro.AcceptPublicContact)
{
try {
if (pro.Performer.Devices.Count > 0) {
var regids = command.PerformerProfile.Performer
.Devices.Select(d => d.GCMRegistrationId);
grep = await _GCMSender.NotifyBookQueryAsync(regids,yaev);
}
_logger.LogError("sending GCM");
// 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;
}
catch (Exception ex)
{
_logger.LogError(ex.Message);
}
try {
ViewBag.EmailSent = await _emailSender.SendEmailAsync(
command.PerformerProfile.Performer.UserName,
command.PerformerProfile.Performer.Email,
$"{command.Client.UserName} (un client) vous demande un rendez-vous",
$"{yaev.CreateBody()}\r\n-- \r\n{yaev.Previsional}\r\n{yaev.EventDate}\r\n"
);
}
catch (Exception ex)
{
_logger.LogError(ex.Message);
}
}
ViewBag.Activity = _context.Activities.FirstOrDefault(a=>a.Code == command.ActivityCode);
ViewBag.GoogleSettings = _googleSettings;