Signup form with first & last name ?
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 28
- Joined: Wed Jun 04, 2008 1:45 am
Signup form with first & last name ?
Is it possible to have the sign up form with first & last name ? currently it only needs email & password , however , i have so many customers with no names that i can't use good enough for marketing .
Regards,
Regards,
Re: Signup form with first & last name ?
Yes that will be an easy job. You just need to add two text boxes in the ConLib/RegisterDialog.ascx and modify the ConLib/RegisterDialog.ascx.cs file to include the code that will add the information from these newly added text boxes to the primary address of the user. This code could be something like below and place it just above the
following line in the ConLib/RegisterDialog.ascx.cs file
//REDIRECT TO APPROPRIATE PAGE
so that it would be something like
Now you can replace the "Your First Name" and "Your Last Name" info with your newly added text boxes
following line in the ConLib/RegisterDialog.ascx.cs file
//REDIRECT TO APPROPRIATE PAGE
so that it would be something like
Code: Select all
newUser.PrimaryAddress.FirstName = "Your First Name";
newUser.PrimaryAddress.LastName = "Your Last Name";
newUser.PrimaryAddress.Save();
//REDIRECT TO APPROPRIATE PAGE
...
...
Re: Signup form with first & last name ?
This is exactly what i need too, thanks - although i'm being dumb in that when you say "Now you can replace the "Your First Name" and "Your Last Name" info with your newly added text boxes" i dont know what i am supposed to add here?!mazhar wrote:Yes that will be an easy job. You just need to add two text boxes in the ConLib/RegisterDialog.ascx and modify the ConLib/RegisterDialog.ascx.cs file to include the code that will add the information from these newly added text boxes to the primary address of the user. This code could be something like below and place it just above the
following line in the ConLib/RegisterDialog.ascx.cs file
//REDIRECT TO APPROPRIATE PAGE
so that it would be something likeNow you can replace the "Your First Name" and "Your Last Name" info with your newly added text boxesCode: Select all
newUser.PrimaryAddress.FirstName = "Your First Name"; newUser.PrimaryAddress.LastName = "Your Last Name"; newUser.PrimaryAddress.Save(); //REDIRECT TO APPROPRIATE PAGE ... ...
The page signs the user up but as i have a personalised greeting on my site it says "Welcome Your First Name"

Re: Signup form with first & last name ?
In order to require this first name and last name information from user you will need to have two text boxes on signup form, for example if they are
Now the update C# code will be something like
Code: Select all
<asp:TextBox ID="FirstName" runat="server" />
<asp:TextBox ID="LastName" runat="server" />
Code: Select all
newUser.PrimaryAddress.FirstName = FirstName.Text;
newUser.PrimaryAddress.LastName = LastName.Text;
newUser.PrimaryAddress.Save();
//REDIRECT TO APPROPRIATE PAGE
...
...
Re: Signup form with first & last name ?
So simple
Thanks alot for your help, very much appreciated

Thanks alot for your help, very much appreciated

- mfreeze
- Commodore (COMO)
- Posts: 421
- Joined: Mon Jan 24, 2005 2:07 pm
- Location: Washington, NJ
- Contact:
Re: Signup form with first & last name ?
This code is great but I have one issue that I have been trying to figure out but have had no success thus far.
I have the following coded
I tried
I just tried emailTemplates[0].ToAddress = Token.Instance.User.Email; but the email still did not go to the customer.
I have the following coded
This works just fine when sending to a static email address that is filled out in the template. However, I need to send a copy to the person registering plus whatever addresses may be in the cc and bcc fields. How to I populate the email template 'to address' with the newUser.PrimaryAddress.Email?EmailTemplateCollection emailTemplates = EmailTemplateDataSource.LoadForCriteria(" Name = 'Validate New User' ");
if (emailTemplates.Count > 0)
{
emailTemplates[0].Parameters.Add("username",newUser.PrimaryAddress.Email);
emailTemplates[0].Parameters.Add("password",Password.Text);
emailTemplates[0].Parameters.Add("firstname",newUser.PrimaryAddress.FirstName);
emailTemplates[0].Parameters.Add("lastname",newUser.PrimaryAddress.LastName);
emailTemplates[0].Parameters.Add("companyname",newUser.PrimaryAddress.Company);
emailTemplates[0].Parameters.Add("address1",newUser.PrimaryAddress.Address1);
emailTemplates[0].Parameters.Add("address2",newUser.PrimaryAddress.Address2);
emailTemplates[0].Parameters.Add("city",newUser.PrimaryAddress.City);
emailTemplates[0].Parameters.Add("state",newUser.PrimaryAddress.Province);
emailTemplates[0].Parameters.Add("zip",newUser.PrimaryAddress.PostalCode);
emailTemplates[0].Parameters.Add("phone",newUser.PrimaryAddress.Phone);
emailTemplates[0].Parameters.Add("license",LicenseNo.Text);
emailTemplates[0].Parameters.Add("licensest",LicenseSt.Text);
emailTemplates[0].Parameters.Add("licenseexp",LicenseExp.Text);
emailTemplates[0].Parameters.Add("taxid",TaxID.Text);
emailTemplates[0].Parameters.Add("existingcust",ExistingCust.SelectedItem.Value);
emailTemplates[0].Parameters.Add("custfunction",CustFunction.SelectedItem.Value);
emailTemplates[0].Send();
I tried
but this doesn't work because template.ToAddress is not available in my form. I know there should be another way but I haven't been able to figure it out.template.ToAddress = template.ToAddress.Replace("vendor", String.Format("{0}", vendor.Email));
I just tried emailTemplates[0].ToAddress = Token.Instance.User.Email; but the email still did not go to the customer.
Mary E Freeze
Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development
http://www.ffgraphics.com
Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development
http://www.ffgraphics.com
Re: Signup form with first & last name ?
Try following code
Code: Select all
//To address
template.ToAddress = newUser.PrimaryAddress.Email;
//CC List
template.CCList = "address1@yourdomain.com,address2@yourdomain.com";
//BCC List
template.BCCList = "address1@yourdomain.com,address2@yourdomain.com";
- mfreeze
- Commodore (COMO)
- Posts: 421
- Joined: Mon Jan 24, 2005 2:07 pm
- Location: Washington, NJ
- Contact:
Re: Signup form with first & last name ?
I tried that and got \ConLib\Custom\NewRegisterDialog.ascx.cs(123): error CS0103: The name 'template' does not exist in the current context on the line in my code where I inserted it.
I have put emailTemplates[0].ToAddress = Token.Instance.User.Email just before the send but it seems to do nothing.
I have put emailTemplates[0].ToAddress = Token.Instance.User.Email just before the send but it seems to do nothing.
Mary E Freeze
Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development
http://www.ffgraphics.com
Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development
http://www.ffgraphics.com
Re: Signup form with first & last name ?
sorry I used template keyword instead of emailTemplates[0]. Any how go to merchant side edit your template and then remove if any thing you specified in To Address section and try again. Although I think even if there is something it should work but better give a try.
- mfreeze
- Commodore (COMO)
- Posts: 421
- Joined: Mon Jan 24, 2005 2:07 pm
- Location: Washington, NJ
- Contact:
Re: Signup form with first & last name ?
It won't let me remove the To address so right now it specifies customer. I removed the cc addresses and now have the following code but no emails are being sent other than to the address that is hardcoded in the BCC field in the template.
//Send Email
EmailTemplateCollection emailTemplates = EmailTemplateDataSource.LoadForCriteria(" Name = 'Validate New User' ");
if (emailTemplates.Count > 0)
{
emailTemplates[0].Parameters.Add("username",newUser.PrimaryAddress.Email);
emailTemplates[0].Parameters.Add("password",Password.Text);
emailTemplates[0].Parameters.Add("firstname",newUser.PrimaryAddress.FirstName);
emailTemplates[0].Parameters.Add("lastname",newUser.PrimaryAddress.LastName);
emailTemplates[0].Parameters.Add("companyname",newUser.PrimaryAddress.Company);
emailTemplates[0].Parameters.Add("address1",newUser.PrimaryAddress.Address1);
emailTemplates[0].Parameters.Add("address2",newUser.PrimaryAddress.Address2);
emailTemplates[0].Parameters.Add("city",newUser.PrimaryAddress.City);
emailTemplates[0].Parameters.Add("state",newUser.PrimaryAddress.Province);
emailTemplates[0].Parameters.Add("zip",newUser.PrimaryAddress.PostalCode);
emailTemplates[0].Parameters.Add("phone",newUser.PrimaryAddress.Phone);
emailTemplates[0].Parameters.Add("license",LicenseNo.Text);
emailTemplates[0].Parameters.Add("licensest",LicenseSt.Text);
emailTemplates[0].Parameters.Add("licenseexp",LicenseExp.Text);
emailTemplates[0].Parameters.Add("taxid",TaxID.Text);
emailTemplates[0].Parameters.Add("existingcust",ExistingCust.SelectedItem.Value);
emailTemplates[0].Parameters.Add("custfunction",CustFunction.SelectedItem.Value);
emailTemplates[0].ToAddress = Token.Instance.User.Email;
emailTemplates[0].CCList = Token.Instance.User.Email;
emailTemplates[0].Send();
}
Mary E Freeze
Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development
http://www.ffgraphics.com
Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development
http://www.ffgraphics.com
- mfreeze
- Commodore (COMO)
- Posts: 421
- Joined: Mon Jan 24, 2005 2:07 pm
- Location: Washington, NJ
- Contact:
Re: Signup form with first & last name ?
I got it. The format is
Thanks for your assistance.
.emailTemplates[0].ToAddress = newUser.PrimaryAddress.Email;
Thanks for your assistance.
Mary E Freeze
Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development
http://www.ffgraphics.com
Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development
http://www.ffgraphics.com