protected override void Handle(ApproveTimesheet command) { var dateTime = DateTime.UtcNow; var timesheetApproved = new TimesheetApproved(command.TimesheetId, command.UserId, dateTime); _saveEventService.SaveEvent(timesheetApproved, dateTime); }
public Task Handle(TimesheetApproved notification, CancellationToken cancellationToken) { ApplicationUser user = _userManager.FindByIdAsync(notification.OwnerId).Result; string msg = string.Format("Your timesheet for week beginning {0} has been approved", notification.WeekStarting.ToShortDateString()); _emailService.SendMail("*****@*****.**", user.Email, "Timesheet Approved", msg, "", string.Empty, string.Empty); return(Task.CompletedTask); }