private async Task notifyFinanceUser(NotifyType type, ExpenseInfo expense, int userId) { var financeUsers = await _userRepository.FindFinanceUser(); var user = await _userRepository.FindAsync(userId); var notifyBody = new NotifyBodyDto() { ExpenseModel = getFormattedExpense(expense), User = user, AbsoluteUrl = getAbsoluteUrl() }; INotifyBodyCreator bodyCreator = _notifyBodyCreatorAccessor(type); var message = bodyCreator.CreateBody(notifyBody); var subject = getNotifySubjectbyType(type); var notifyData = new NotifyDataDto() { To = financeUsers, Message = message, Subject = _localizer.Localize(subject) }; await notifyUser(notifyData); }
public string CreateBody(NotifyBodyDto notifyBody) { var htmlStr = ""; htmlStr += $"<div>An expense file uploaded by {notifyBody.User.FirstName} {notifyBody.User.LastName} at {notifyBody.ExpenseModel.UploadDate}.</div>" + $"<div>View uploaded expence: <a target='_blank' href='{notifyBody.AbsoluteUrl}/account/viewexpensefile/{notifyBody.ExpenseModel.Id}'>View File</a></div>"; return(htmlStr); }
public string CreateBody(NotifyBodyDto notifyBody) { var htmlStr = ""; htmlStr += $"<div>An expense file by Id {notifyBody.ExpenseModel.Id} for {notifyBody.User.FirstName} {notifyBody.User.LastName} <b>was Declined</b></div>" + $"<div>View declined expense: <a target='_blank' href='{notifyBody.AbsoluteUrl}/account/viewexpensefile/{notifyBody.ExpenseModel.Id}'>View File</a></div>"; return(htmlStr); }