Please enable JavaScript to view this site.

iService Forms User Guide

Navigation: Form Examples > Contact Update/Import Forms

Using a Contact Import Form to Add Contacts to a Mailing List or Campaign

Scroll Prev Top Next More

If you are importing a list of contacts and want to add them to one of your mailing lists, you can use the -addtolist or “addtocampaign” parameter within your form body. This parameter will convert the input command into a check box for subscribing the contact to the list or campaign specified. If the user was previously on the list and opted out, their preference will not be overridden. So, it is safe to add contacts this way even if they were previously on the list.

The example below shows how to modify an existing contact import form to allow subscription. In the example below, each contact is added to the mailing list whose ID is 1. The name of the list that is shown below (CustomerList) can be anything and is used to make the form easier to understand. We suggest using the name of the list as specified in the Mailing List page. The full set of lists and campaigns available are shown in the Form Variable Picker on the forms page.

When you import your file using the iService Batch Submit Utility, include a column within your CSV input file with the ID that corresponds to the list. In the example below the column name of your CSV input file would be "Form-List". Then, includes the value “true” for each contact that needs to be added to the list or campaign, and the value "False" for each contact you want excluded from the list.

The full form body for this example is shown below, with the changes highlighted. There are no changes required to the form action.

<html>

<body>

<form method="POST">

 

Email Address: $input -email -id'email' -required$<br />

First Name: $input -contactProperty1'firstname' -id'firstname'$<br />

Last Name: $input -contactProperty3'lastname' -id'lastname'$<br />

Company: $input -contactProperty7'company' -id'company'$<br />

Address1: $input -contactProperty15'address1' -id'address1'$<br />

Address2: $input -contactProperty16'address2' -id'address2'$<br />

City: $input -contactProperty17'city' -id'city'$<br />

State: $input -contactProperty18'state' -id'state'$<br />

Postal Code: $input -contactProperty19'postalcode' -id'postalcode'$<br />

Customer Type: $input -contactProperty6'Customer Type' -id'customertype'$<br />

Click to Join: $input -id'List' -addtolist1'CustomerList'$<br />

 

<input type="submit" id="ok" name="ok" value="Create/Update Contact" /><br />

 

<div style="background-color:yellow;">$errormessage$</div>

</form>

</body>

</html>