public void Send(IUserProfile userProfile, string baseUrl, Guid?websiteId)
        {
            int num;

            baseUrl = baseUrl.TrimEnd(new char[] { '/' });
            SiteContext.AllowForAdmin();
            bool    flag           = userProfile is AdminUserProfile;
            string  str            = (flag ? AdminUserNameHelper.AddPrefix(userProfile.UserName) : userProfile.UserName);
            dynamic expandoObjects = new ExpandoObject();

            expandoObjects.UserName      = userProfile.GetDisplayName();
            expandoObjects.UserEmail     = userProfile.UserName;
            expandoObjects.ActivationUrl = string.Concat(baseUrl, this.AuthenticationService.GeneratePasswordResetUrl(str, false));
            dynamic obj = expandoObjects;

            num = (flag ? this.ConsoleSecuritySettings.EmailedPasswordLinkValidForDays : this.StorefrontSecuritySettings.EmailedPasswordLinkValidForDays);
            obj.ActivationUrlExpirationInDays = num;
            expandoObjects.ContentBaseUrl     = baseUrl;
            string    str1           = string.Concat((flag ? "Admin" : "Website"), "_AccountActivation");
            EmailList orCreateByName = this.UnitOfWork.GetTypedRepository <IEmailListRepository>().GetOrCreateByName(str1, "Insite Commerce Account Activation", "");

            this.EmailService.SendEmailList(orCreateByName.Id, userProfile.Email, expandoObjects, string.Empty, this.UnitOfWork, websiteId);
            if (userProfile.ActivationStatus == UserActivationStatus.EmailNotSent.ToString())
            {
                userProfile.ActivationStatus = UserActivationStatus.EmailSent.ToString();
            }
            userProfile.LastActivationEmailSentOn = new DateTimeOffset?(DateTimeProvider.Current.Now);
            this.UnitOfWork.Save();
        }