public async Task SendConfirmationEmailAsync(string Id, string url, params string[] bodyParams) { var user = userRepository.GetById(Id); if (user == null) { throw new OwnNullArgumentException("Invalid user id"); } var token = await tokenProvider.GenerateTokenAsync(user); var messageBody = messageBodyProvider.GetBody(bodyParams); messageBody.AddReplacement(url + $"?id={Id}&token={token}", "{Link}"); emailService.SendMail("Uper", user.Email, messageType, messageBody); }
public void SendOfferStateChangedEmail(ApplicationUser user, string urlToTrip, OfferStateChange stateChange) { string msgType = stateTypeDict[stateChange]; emailService.SendMail("Uper", user.Email, msgType, bodyProvider.GetBody(user.UserName, urlToTrip, stateChange)); }