Example #1
0
        private void LoadStrings()
        {
            btnSubmit.Text = Lang.Trans("Submit");
            WideBoxStart1.Title = Lang.Trans("Invite a Friend");

            var inviteFriendTemplate = new EmailTemplates.InviteFriend(LanguageId);
            string value = inviteFriendTemplate.GetFormattedBody(CurrentUserSession.Name);
            value = value.Replace("%%USERNAME%%", CurrentUserSession.Username);
            if (ckeditor != null)
                ckeditor.Text = value;
            if (htmlEditor != null)
                htmlEditor.Content = value;
        }
        private void LoadStrings()
        {
            btnSubmit.Text = Lang.Trans("Submit");
            btnImport.Text = "Import".Translate();
            WideBoxStart1.Title = Lang.Trans("Invite friends from your address book");

            var inviteFriendTemplate =
                new EmailTemplates.InviteFriend(LanguageId);
            string value = inviteFriendTemplate.GetFormattedBody(CurrentUserSession.Name);
            value = value.Replace("%%USERNAME%%", CurrentUserSession.Username);
            if (ckeditor != null)
                ckeditor.Text = value;
            else if (htmlEditor != null)
                htmlEditor.Content = value;

            dgContacts.Columns[1].HeaderText = "Name".Translate();
            dgContacts.Columns[2].HeaderText = "Email".Translate();
        }
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            var inviteFriendTemplate = new EmailTemplates.InviteFriend(LanguageId);

            HtmlInputCheckBox cbCheck;
            foreach (DataGridItem item in dgContacts.Items)
            {
                cbCheck = (HtmlInputCheckBox)item.FindControl("cbSelect");
                if (cbCheck.Checked)
                {
                    string content = htmlEditor != null ? htmlEditor.Content : ckeditor.Text;
                    Email.Send(Config.Misc.SiteTitle, Config.Misc.SiteEmail, ((Label)item.FindControl("lblName")).Text,
                               ((Label)item.FindControl("lblEmail")).Text,
                               inviteFriendTemplate.GetFormattedSubject(CurrentUserSession.Name), content,
                               false);
                }
            }

            StatusPageMessage = Lang.Trans("The invitation email has been sent to your friend.");
            Response.Redirect("ShowStatus.aspx");
        }
Example #4
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                Classes.User.ValidateEmail(txtFriendsEmail.Value.Trim());
            }
                //invalid email
            catch
            {
                lblError.Text = Lang.Trans("Invalid email!");
                return;
            }

            try
            {
                var inviteFriendTemplate = new EmailTemplates.InviteFriend(LanguageId);
                string body = htmlEditor != null ? htmlEditor.Content : ckeditor.Text;
                Email.Send(Config.Misc.SiteTitle, Config.Misc.SiteEmail, txtFriendsName.Value, txtFriendsEmail.Value.Trim(),
                           inviteFriendTemplate.GetFormattedSubject(CurrentUserSession.Name), body,
                           false);
            }
            catch (Exception ex)
            {
                Log(ex);
                return;
            }

            StatusPageMessage = Lang.Trans("The invitation email has been sent to your friend.");
            Response.Redirect("ShowStatus.aspx");
        }