public void Invite(string email) { var mcUser = _context.GetUsers(email).SingleOrDefault(); if (mcUser == null) { throw new McUserNotFoundException(); } var inviteEmailModel = new InviteEmailModel(mcUser); _inviteEmailService.Send(inviteEmailModel); if (mcUser.InviteDateUtc == null) { mcUser.InviteDateUtc = _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 InviteEmailModel(user); _service.Send(model); _mockNotificationClientWrapper.Verify(x => x.SendEmail(user.Email, _templateId, personalisation, null, null), Times.Once); }