Use the /atg/campaign/servlet/OptOutFormHandler
to give users a global opt-out option for e-mail communications. This form handler sets a profile’s receiveEmail
property to true
(yes) or false
(no), and sends an opt-out message that is used for reporting.
For detailed information on using form handlers in JSP pages, refer to the ATG Page Developer’s Guide.
OptOutFormHandler Test Page
<%@ taglib uri="http://www.atg.com/taglibs/daf/dspjspTaglib1_0" prefix="dsp" %> <%@ taglib uri="http://www.atg.com/taglibs/daf/dspjspELTaglib1_0" prefix="dspel" %> <%@ page import="atg.servlet.*"%> <dsp:page> <dsp:importbean bean="/atg/campaign/servlet/OptOutFormHandler"/> <dsp:importbean bean="/atg/userprofiling/Profile"/> <html> <head> <title>OptOutFormHandler test page</title> </head> <body> <h3>OptOutFormHandler test page</h3> <dsp:form action="OptOutFormHandler_test_page.jsp" method="post"> <p>Current profile: <dsp:valueof bean="Profile.firstName"/> <dsp:valueof bean="Profile.lastName"/> (<code>receiveEmail</code> property currently set to <strong><dsp:valueof bean="OptOutFormHandler.receiveEmail"/></strong>) <p><dsp:input bean="OptOutFormHandler.receiveEmail" type="checkbox"/> Yes, send me e-mail! <br> <br> <dsp:input bean="OptOutFormHandler.submit" type="Submit" value="Submit"/> </dsp:form> </body> </html> </dsp:page>