Constant Contact wants to help you succeed! We’re celebrating our professional service programs on the Constant Contact Community this month and you have a chance to try one of the services for free! Learn more.
This page is intended to help users use the ASP Email Campaign Form sample application.
Users will have to set up the API Key, account Username and Password in order to access the Constant Contact resources. The following features are available: add/edit Email Campaign, search for Email Campaign by its Status, list Email Campaigns, remove Email Campaign from lists or unsubscribe its Contacts Lists.
To set up the authentication data, you need to change the following keys from the web.config file, found in the project:
Users can create a new Email Campaign by filling out the form from the Add Email Campaign page top link.
Required fields are: Campaign Name, Subject, From Name, From Email Address, Reply Email Address, Organization Name, Address 1, City, Zip/Postal Code, Country, Atleast on ContactList checked, Content (if Email Content Format is set to HTML) or XContent (if Email Content Format is set to XHTML), TextContent.
Fields like Content or XContent must containt the exact html tags as in this example: <html>, <body>, and the entire structure of <OpenTracking>. The TextContent content must always be enclosed in <Text></Text> tags.
If Email Campaign does not exist, it will be added to the lists and you are given the message below.
Note that this only works if the specified name for this email campaign is not in use by another campaign. If the name is already in use you are notified about this uppon saving. To update an existing email campaign then you have to go to “List all Email Campaigns” and click edit on the desired item. After that you will be redirected to the page for Adding Campaign, with the fields already filled, but in this case the campaign will not be recreated, instead it will be updated with the modifications you specified informing you of the success of the operation with this message.
The List all Emails Campaigns option will display all campaigns that the acount owner has. To edit a campaign you have to press the Edit button alongside of the campaign row. Note that campaigns in a different state that DRAFT can not be modified anymore.The Remove button will remove the campaign from the list but will not delete it phisically, thus the name will be blocked if you want to furthere use it.
You can filter to the list using the campaign state as criteria. Select the campaign state from the dropdownlist and press Sign-Up to apply the filtration over the campaigns you already created.
ASP Email Campaign form uses the following types:
In the Release/Setup folder, double click the setup.exe to begin the installation of ASP Net Sample application.
Click the Next button then choose the Site where this application will be installed. Also the Virtual directory name can be specified.
Pressing the Next button will guide you to the Confirmation Step. Pressing again the Next button will start the installation process. After it is completed press the Close button to close the wizard.
Before staring the sample API Key, Username and Password must be defined. To do that, you should edit the web.config configuration file from the %SystemDrive%\Inetpub\wwwroot\EmailCampaignSetup folder.
Note: If you changed the Virtual directory when installing the sample then you should found the web.config file in the following folder %SystemDrive%\Inetpub\wwwroot\[virtual_directory] ([virtual_directory] it should mach the folder you specified for the Virtual directory).
Open the configuration file and edit the following key values: APIKey, username, password.
To view the sample open a browser and type in the following address http://localhost/EmailCampaignsSetup and press enter.
The [BaseFolder]\EmailCampaigns.sln file represents the Visual Studio 2008 solution project for this application and is composed of three projects: two class library projects (EmailCampaigns.Business and EmailCampaigns.Data) and the web project itself (EmailCampaigns.Web - provides access to the following .NET wrapper objects: Contact Lists, Contact, Email, EmailCampaign, Country, State; BusinessUtility - provides access to utility methods to create a new EmailCampaign, update an existing one, search campaign by State, etc).
The EmailCampaigns.Data project consists of the following files: Contact.cs (contains information's about a Constant Contact), ContactList.cs (contains information's about a Constant Contact List), Email.cs (contains information regarding current user's emails), Country.cs & State.cs (contains information about country and state), EmailCampaign.cs (the most important model that will contain infromation of the actual email campaign), Enums.cs (used enums describing different states or properties) and one class diagram file named ClassDiagram.cd that describes the structure of EmailCampaigns.Data project.
The EmailCampaigns.Business project consists of the following files: ContactComponent.cs (contains class used parse response streams into Contacts, creates entries for creating and updating Contacts, etc.), ContactListComponent.cs (contains class used to parse response streams into Contact Lists, creates entries for creating and updating Contact Lists, etc.), AuthenticationData.cs (contains class used to store API Key, username and password for the Constant Contact REST API), EmailCampaignComponent.cs (parse response into Email Campaign - creating entity, updating or searching for it), EmailComponent.cs (parsing streamed information into user email model), BusinessUtility.cs (provides utility methods to create a new Campaign, update an existing one, filter, etc.), Utils.cs (utility methods used in processing information) and one class diagram file named ClassDiagram.cd that describes the structure of theEmailCampaigns.Business project.
The web project consists of the following files:
If you want to import pages from this sample into your web site, you need to:
1: <configuration> 2: <appSettings> 3: <!--API Application Key and is used to identify the application making an API request--> 4: <add key="APIKey" value=""/> 5: <!--Constant Contact Customers user name--> 6: <add key="username" value=""/> 7: <!--Constant Contact Customers password--> 8: <add key="password" value=""/> 9: </appSettings> 10: </configuration> 11:
3. add references to your project for the following assemblies: EmailCampaigns.Business.dll and EmailCampaigns.Data.dll (from the [BaseFolder]\Bin\Debug folder)
4. customize the page as you want (e.g. change some displayed text, remove unwanted fields).