public void SendUserCreatedNotification(ConfirmNotification notification, UserCreatedCommand command) { using (var session = usersSessionFactory.CreateContext()) { SendConfirmEmailNotification(notification, session.Users.Where(u => u.ObjectId == command.UserId) .Select(u => u.UserEmails.Select(e => e.Email).FirstOrDefault()).SingleOrDefault()); } }
private void ModifyPersona_Click(object sender, RoutedEventArgs e) { var notification = ConfirmNotification.CreateNotificaion(); //DynamicMojo.SwapMethodBodies( // typeof(ConfirmNotification).GetMethod(nameof(notification.DoWhenFinished)), // typeof(FichaPersona).GetMethod(nameof(ModifyContent)) //); notification.WhenDone += ModifyContent; }
private void SendConfirmEmailNotification(ConfirmNotification notification, string email) { using (var session = usersSessionFactory.CreateContext(true)) { var user = session.UserEmails.Single(u => u.Email == email); if (!user.IsEmailConfirmed) { notification.To = user.Email; notification.Email = user.Email; notification.ConfirmationCode = new PasswordGenerator().GeneratePassword(10, true, true, false); user.EmailConfirmationCode = notification.ConfirmationCode; var not = session.Notifications.Single(n => n.Id == (int)NotificationTypes.ConfirmEmail); notification.MessageTemplate = not.Message; notification.Subject = not.Subject; notification.Execute(); } } }
public EmailChangedCommandHandler(ConfirmNotification notification) { this.notification = notification; }
public UserCreatedCommandHandler(NotificationService notificationService, ConfirmNotification notification) { this.notificationService = notificationService; this.notification = notification; }
public void SendEmailChangedNotification(ConfirmNotification notification, EmailChangedCommand command) { SendConfirmEmailNotification(notification, command.Email); }