Blog‎ > ‎

How to allow someone to join a mailing list on OpenACS

posted Dec 23, 2008, 9:59 PM by Jade Rubick

Index: user-new.tcl
===================================================================
RCS file: /var/cvs/safe4all/packages/acs-subsite/lib/user-new.tcl,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 user-new.tcl
--- user-new.tcl        22 Jun 2004 21:06:53 -0000      1.1.1.2
+++ user-new.tcl        5 Oct 2004 17:41:39 -0000
@@ -39,6 +39,20 @@

ad_form -name register -export {next_url user_id return_url} -form [auth::get_r
egistration_form_elements]

+# safe4all.org extention
+
+set checked_p [list checked ""]
+
+ad_form -extend -name register -form {
+    {join_announce_p:text(checkbox),optional
+        {label "Receive weekly news?"}
+        {help_text "You can opt out at any point, and we do not give out your email address."}
+        {options {{"" "on"}}}
+        {html $checked_p}
+    }
+}
+
+
if { [exists_and_not_null rel_group_id] } {
    ad_form -extend -name register -form {
        {rel_group_id:integer(hidden),optional}
@@ -81,6 +95,21 @@
                                      -secret_question $secret_question \
                                      -secret_answer $secret_answer]

+        # safe4all.org
+
+        if {[string equal $creation_info(creation_status) "ok"]} {
+            if {[string is true $join_announce_p]} {
+                ns_sendmail \
+                    "safe-announce-subscribe@mail.safe4all.org"; \
+                    $email \
+                    "join safe-announce mailing list" \
+                    "I would like to join the SAFE-announce mailing list. Infor\
mation on subscribing and unsubscribing are available at http://www.safe4all.or\
g/forums/forum-view?forum%5fid=13394"
+
+            }
+        }
+
        if { [string equal $creation_info(creation_status) "ok"] && [exists_and
_not_null rel_group_id] } {
            group::add_member \
                -group_id $rel_group_id \

Comments