The optOutTest.jsp
page displays a simple form with four “opt out” e-mail categories: Newsletter, Special Deals, Industry News and Quarterly Account Updates.
Like the previous example, opt-out forms use the /atg/userprofiling/ProfileFormHandler
to update the user’s profile. However, in this case, the form handler updates the emailOptOuts
profile property.
Note: The value
setting of each dspel:input
tag must match the actual file name of the corresponding opt-out 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.emailOptOuts" type="checkbox" value="Newsletter_Opt_Out"/></td> <td valign="middle" align="left">Newsletter</td> <td align="right"><dspel:input bean="ProfileFormHandler.value.emailOptOuts" type="checkbox" value="Industry_News_Opt_Out"/></td> <td valign="middle" align="left">Industry News</td> </tr> <tr> <td align="right"><dspel:input bean="ProfileFormHandler.value.emailOptOuts" type="checkbox" value="Special_Deals"/></td> <td valign="middle" align="left">Special Deals</td> <td align="right"><dspel:input bean="ProfileFormHandler.value.emailOptOuts" type="checkbox" value="Account_Status_Opt_Out"/></td> <td valign="middle" align="left">Quarterly Account Updates</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 an e-mail opt-out category and submits the form, the ProfileFormHandler
adds that category to the emailOptOuts
property in her user profile.
Once your opt-out form is in place, create and deploy an opt-out segment for each e-mail category in the form. See Creating Opt-in and Opt-out Segment Assets for details.