Checkbox on my aspx form

Occasional Participant

Checkbox on my aspx form

Hi,


What I'm trying to do should be simple I hope. All I want to do is add a checkbox to my already complete form I designed in asp.net that if checked will automatically send a request to constant contact to add to my mailing list. I need a detailed approach to make this happen cos I'm new to this. Thanks in advance.


 

5 REPLIES 5
Employee

Hello, In order to add a checkbox that, if checked, will add the contacts to a list to be sent newsletters, you will first need to add the checkbox to your web form.



Once this is done, you would need to add an if statement in your code, where the form is being submitted, that checks to see if the button is checked.



If it is checked, you would need to do a POST call to the Contact Collection API, with XML that you create for the contact. You can find out more information on how to format your XML, as well as how to do the POST call here.



Our Sample Forms have examples of doing a POST to the Contact Collection API using ASP.NET. Also, if you run into any issues and have more questions please let us know on the forums.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Occasional Participant

Thanks Ben for your response but I'm still lost because I'm using asp.net for the first time so is it possible to break down exactly what I need to do in steps so I can just follow it? Thanks in advance.

Employee

Hi,



While I am not an expert in ASP.NET, I can try to give you a rough walkthrough on how to do this. However, if you would like more hands on help with ASP.NET programming, we do have a marketplace that has a listing of Solution Providers who may be able to help you further if you get stuck in something. These Solution Providers are third party individuals or organizations who have expressed interest and experience in working with Constant Contact integrations.



The first thing you would do in your application is create the checkbox, and you would need to add an If statement in the code that checks to see if the box is checked, and if it is, you would need to do a POST with our API. If the box is not checked, it would just skip this section and do nothing.



If the box is checked, you would need to do an HTTP POST call in ASP.NET, to https://api.constantcontact.com/ws/customers/(your username)/contacts with your credentials, the username is (your API key)%(your username) and then your password to the account. In this call, you would need to send XML that you create, with information the customer has given you. The directions on setting up the XML can be found here.



If the POST is done correctly, it will give a success message, if there is an error, here is a list of error codes that could be the problem.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Participant

 All I want to do is add a checkbox to my already complete form I designed in wordpress and i'm using the plugin Contact Form 7.  That if checked will automatically send a request to constant contact to add to my mailing list.

Employee

Unfortunately there is no way to insert just 1 line into your form that create a checkbox that is hooked up to your account, and allow the functionality that you are looking for. The steps that Ben provided are correct, and that is how you would want to proceed. While we are more than happy to assist with any specific questions that you may have and help with any snags that you run into, we cannot code this for you. If you need someone to do this for you, I would recommend viewing the Marketplace as Ben suggested, as there are Solutions Providers there that are experienced with integrations and would be able to offer assistance.


 


Alternatively, you can use our Join My Mailing List form, which is available in your account by clicking on the "Contacts" tab, followed by the "Join My Mailing List" link. This will provide you with an HTML form that will be hooked up to your Constant Contact account.


 


You could also use our Constant Contact Signup Form Generator which is a PHP application that would need to be uploaded to your web server, and allow you to create custom forms that are linked to your account as well.


 


I apologize for any inconvenience this has caused. If you have any further questions please feel free to ask and we will do our best to assist you. Thanks.

David J

Developer Portal

View API documentation, code samples, get your API key.

Visit Page