The optInTest.jsp page displays a simple form (shown below) with four “opt in” e-mail categories: Sunny Beach Escapes, Cruise Deals, Family Vacations and Last Minute Deals.

As you can see in the following code snippet, this form uses the /atg/userprofiling/ProfileFormHandler to set the value of the user’s emailOptIns profile property. (For more information about the ProfileFormHandler, see the ATG Page Developer’s Guide.)

Note: The value setting of each dspel:input tag must match the actual file name of the corresponding opt-in segment. For more information about segment names, see the Creating Opt-in and Opt-out Segment Assets section.

<table width="456" border="0">

<tr>
  <td align="right"><dspel:input bean="ProfileFormHandler.value.emailOptIns"
    type="checkbox" value="Beach_Escapes"/></td>
  <td valign="middle" align="left">Sunny Beach Escapes</td>
  <td align="right"><dspel:input bean="ProfileFormHandler.value.emailOptIns"
    type="checkbox" value="Family_Vacations"/></td>
  <td valign="middle" align="left">Family Vacations</td>
</tr>

<tr>
  <td align="right"><dspel:input bean="ProfileFormHandler.value.emailOptIns"
    type="checkbox" value="Cruise_Deals"/></td>
  <td valign="middle" align="left">Cruise Deals</td>
  <td align="right"><dspel:input bean="ProfileFormHandler.value.emailOptIns"
    type="checkbox" value="Last_Minute_Deals"/></td>
  <td valign="middle" align="left">Last Minute Deals</td>
</tr>

<tr>
  <td valign="middle" align="right"></td>
  <td><dspel:input bean="ProfileFormHandler.update" type="submit"
    value="Save Changes"/></td>
</tr>

</table>

If a user selects any of the e-mail categories and submits the form, the ProfileFormHandler adds the selected categories to the emailOptIns property in his user profile. Conversely, if the user unchecks an e-mail option, the ProfileFormHandler removes that category from the emailOptIns list.

Once your opt-in form is in place, create and deploy an opt-in segment for each e-mail category in the form. See Creating Opt-in and Opt-out Segment Assets for details.

 
loading table of contents...