예제 #1
0
        private void SendRegistrationEmail(string emailAddress, string firstName, string lastName, string key)
        {
            var emailModel = new KeyedEmailModel
            {
                EmailAddress = emailAddress,
                FirstName    = firstName,
                LastName     = lastName,
                Key          = key
            };

            var message = ControllerContext.Render("_AddEmailPartial", new ViewDataDictionary(emailModel)).ToString();

            EmailUtils.Send(message, emailAddress, firstName, lastName, subject: ControllerRes.Account.Email_SubjectUserRegistration);
        }
예제 #2
0
        /// <summary>
        /// Generates the e-mail using the extension method ControllerContext.Render()
        /// </summary>
        /// <param name="emailAddress">The e-mail address to send the reset email to.</param>
        /// <param name="key">The unique secret key sent only to that e-mail address that verifies it reached the right person and they can reset their account.</param>
        /// <param name="firstName">First name of the user.</param>
        /// <param name="lastName">Last name of the user.</param>
        private void SendResetEmail(string emailAddress, string key, string firstName = null, string lastName = null)
        {
            // Send email for password reset completion.
            var emailModel = new KeyedEmailModel
            {
                EmailAddress = emailAddress,
                FirstName    = firstName,
                LastName     = lastName,
                Key          = key
            };

            var message = ControllerContext.Render("_ResetEmailPartial", new ViewDataDictionary(emailModel)).ToString();

            EmailUtils.Send(message, emailAddress, firstName, lastName, subject: Account.Email_SubjectPasswordReset);
        }