Пример #1
0
        public static void SendEmailVerification(int customerID, string email, string body = "")
        {
            // Create the publicly-accessible verification link
            string sep = "&";

            if (!GlobalSettings.Emails.VerifyEmailUrl.Contains("?"))
            {
                sep = "?";
            }

            string encryptedValues = Security.Encrypt(new
            {
                CustomerID = customerID,
                Email      = email,
                Date       = DateTime.Now
            });

            var verifyEmailUrl = GlobalSettings.Emails.VerifyEmailUrl + sep + "token=" + encryptedValues;


            // Send the email
            Exigo.SendEmail(new SendEmailRequest
            {
                To                = new[] { email },
                From              = GlobalSettings.Emails.NoReplyEmail,
                ReplyTo           = new[] { GlobalSettings.Emails.NoReplyEmail },
                SMTPConfiguration = GlobalSettings.Emails.SMTPConfigurations.Default,
                Subject           = "{0} - Verify your email".FormatWith(GlobalSettings.Company.Name),
                Body              = (body.IsNullOrEmpty()) ? @"
                    <p>
                        {1} has received a request to enable this email account to receive email notifications from {1} and your upline.
                    </p>

                    <p> 
                        To confirm this email account, please click the following link:<br />
                        <a href='{0}'>{0}</a>
                    </p>

                    <p>
                        If you did not request email notifications from {1}, or believe you have received this email in error, please contact {1} customer service.
                    </p>

                    <p>
                        Sincerely, <br />
                        {1} Customer Service
                    </p>"
                                    .FormatWith(verifyEmailUrl, GlobalSettings.Company.Name) : body.FormatWith(verifyEmailUrl, GlobalSettings.Company.Name)
            });
        }