Example #1
0
        public void CreateInvitation(User invitedUser)
        {
            var client = new EmailClient(sender: EmailCredentials.Email,
                                         senderPassword: EmailCredentials.Password,
                                         host: ConfigurationManager.AppSettings["appSettings:emailHost"]);
            var registrationTokenUrlEnc = WebUtility.UrlEncode(invitedUser.RegistrationToken);
            var baseUrl       = ConfigurationManager.AppSettings["appSettings:websiteUrl"];
            var invitationUrl = baseUrl + Strings.UserInvitationUrlPath + "?registrationToken=" + registrationTokenUrlEnc;

            var emailBody = string.Format(format: _htmlString, invitedUser.FirstName, invitationUrl);
            var subject   = Strings.UserInvitationSubject;

            client.SendEmailInBackground(subject, emailBody, invitedUser.Email);
        }