'Generates the form for an optin/optout page'

def _render_opt_in_out(self, msg_hash, leave):

    email = Email.handler.get_recipient(msg_hash)
    if (not email):
        return self.abort404()
    sent = (has_opted_out(email) == leave)
    return BoringPage((_('opt    out') if leave else _('welcome    back')), content=OptOut(email=email, leave=leave, sent=sent, msg_hash=msg_hash)).render()
