private void SendWelcomeEmail(User user) { if (user.WelcomeEmailDateUtc == null) { var welcomedata = new WelcomeEmailModel(user); _welcomeEmailService.Send(welcomedata); user.WelcomeEmailDateUtc = _clock.UtcNow; } _context.Save(); }
public void Send() { var user = new User() { Email = "actual email address", FirstName = "FirstName there are spaces at the end " }; var personalisation = new Dictionary <string, dynamic>() { { "first_name", user.FirstName.Trim() } }; var model = new WelcomeEmailModel(user); _service.Send(model); _mockNotificationClientWrapper.Verify(x => x.SendEmail(user.Email, _templateId, personalisation, null, null), Times.Once); }