Пример #1
0
        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);
        }
Пример #2
0
        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));
        }