/// <summary> /// Handles the event. /// </summary> /// <param name="message">The message.</param> /// <returns> /// the task /// </returns> public async Task HandleEvent(EntityInsertedMessage <Comment> message) { if (message.Entity.ReportId.HasValue) { await this.NotifyCommentOnReport(message.Entity); } else { await this.NotifySubcomment(message.Entity); } }
public async Task HandleEvent(EntityInsertedMessage <Request> message) { var request = message.Entity; var url = $"{this.configuration["SiteUrl"]}/requests"; var requester = this.webCacheService.GetUserById(request.UserRequesterId); var parameters = new List <NotificationParameter>(); parameters.Add("UserRequester.Name", requester.Name); parameters.Add("UserRequester.PhoneNumber", requester.PhoneNumber); await this.notificationService.NewNotification(requester, null, NotificationType.NewRequest, url, parameters); }
/// <summary> /// Handles the event. /// </summary> /// <param name="message">The message.</param> /// <returns> /// the task /// </returns> public async Task HandleEvent(EntityInsertedMessage <User> message) { var user = message.Entity; var targetUrl = this.seoService.GetFullRoute("login"); var parameters = new List <NotificationParameter>(); parameters.AddOrReplace("User.PasswordRecoveryToken", user.PasswordRecoveryToken); await this.notificationService.NewNotification( user, null, NotificationType.Welcome, targetUrl, parameters); }
/// <summary> /// Handles the event. /// </summary> /// <param name="message">The message.</param> /// <returns>the task</returns> public async Task HandleEvent(EntityInsertedMessage <SystemSetting> message) { await this.Clean(); }