Mercurial Hosting > nabble
diff src/nabble/view/web/mailing_list/Unsubscribe2.java @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children | 18cf4872fd7f |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/nabble/view/web/mailing_list/Unsubscribe2.java Thu Mar 21 19:15:52 2019 -0600 @@ -0,0 +1,62 @@ + +package nabble.view.web.mailing_list; + +import java.io.IOException; +import java.io.PrintWriter; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import nabble.model.Node; +import nabble.model.ListServer; +import nabble.model.MailingList; +import nabble.model.ModelHome; +import nabble.model.User; +import nabble.view.lib.Jtp; +import nabble.view.lib.Shared; +import fschmidt.util.mail.MailAddress; + + +public final class Unsubscribe2 extends HttpServlet { + + protected void service(HttpServletRequest request,HttpServletResponse response) + throws ServletException, IOException + { + PrintWriter out = response.getWriter(); + String context = request.getContextPath(); + User user = Jtp.getUser(request,response); + if( user==null ) { + Jtp.login("You must login to be able to subscribe to a list.",request,response); + return; + } + Node forum = Jtp.getSiteNotNull(request).getNode(Long.parseLong(request.getParameter("forum"))); + MailingList mailingList = forum.getAssociatedMailingList(); + ListServer listServer = mailingList.getListServer(); + MailAddress emailAddress = new MailAddress(user.getEmail(), user.getName()); + + out.print( "\r\n<html>\r\n<head>\r\n" ); + + Shared.title(request,response,"Subscribe to mailing list"); + + out.print( "\r\n</head>\r\n<body>\r\n" ); + Shared.minHeader(request, response, forum); + out.print( "\r\n<h1>Unsubscription Request Was Sent</h1>\r\n<p>\r\n An unsubscription request was sent on your behalf to the mailing list: <strong>" ); + out.print( (mailingList.getListAddress()) ); + out.print( "</strong>.\r\n</p>\r\n<p>\r\n You will soon receive a confirmation request by email at <strong>" ); + out.print( (user.getEmail()) ); + out.print( "</strong>. Please follow the\r\ninstructions in this request to unsubscribe from the mailing list.\r\n</p>\r\n<p>\r\n <strong>Remember:</strong> You are not unsubscribed from the <strong>" ); + out.print( (mailingList.getListAddress()) ); + out.print( "</strong> list until you have followed the instructions in the email.\r\n</p>\r\n\r\n<br /><br />\r\n<p>« <a href=\"" ); + out.print( (Jtp.path(forum)) ); + out.print( "\">Return to forum</a></p>\r\n" ); + + Shared.footer(request,response); + Shared.analytics(request,response); + + out.print( "\r\n</body>\r\n</html>\r\n" ); + + } +} +