Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/lib/member-email.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/lib/member-email.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/dotlrn/sql/postgresql/community-memberships-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/community-memberships-create.sql,v
diff -u -r1.2.12.1 -r1.2.12.2
--- openacs-4/packages/dotlrn/sql/postgresql/community-memberships-create.sql 31 May 2005 23:13:04 -0000 1.2.12.1
+++ openacs-4/packages/dotlrn/sql/postgresql/community-memberships-create.sql 21 Jul 2005 22:48:54 -0000 1.2.12.2
@@ -75,3 +75,17 @@
where dotlrn_member_rels_full.rel_id = dotlrn_admin_rels.rel_id;
--
+
+-- Store emails to be sent when user joins a community
+create table dotlrn_member_emails (
+ email_id serial primary key,
+ community_id integer references dotlrn_communities_all
+ on delete cascade,
+-- Might be useful
+ type text default 'on join',
+ from_addr text,
+ subject text,
+ email text,
+ enabled_p boolean default 'f',
+ constraint dotlrn_member_emails_un unique(community_id, type)
+);
Index: openacs-4/packages/dotlrn/sql/postgresql/community-memberships-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/community-memberships-drop.sql,v
diff -u -r1.2.12.1 -r1.2.12.2
--- openacs-4/packages/dotlrn/sql/postgresql/community-memberships-drop.sql 31 May 2005 23:13:04 -0000 1.2.12.1
+++ openacs-4/packages/dotlrn/sql/postgresql/community-memberships-drop.sql 21 Jul 2005 22:50:42 -0000 1.2.12.2
@@ -25,6 +25,7 @@
-- @version $Id$
--
+drop table dotlrn_member_emails;
drop view dotlrn_admin_rels_full;
drop table dotlrn_admin_rels;
drop view dotlrn_member_rels_approved;
Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v
diff -u -r1.191.2.4 -r1.191.2.5
--- openacs-4/packages/dotlrn/tcl/community-procs.tcl 19 Jul 2005 06:43:37 -0000 1.191.2.4
+++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 21 Jul 2005 22:48:54 -0000 1.191.2.5
@@ -855,6 +855,9 @@
-community_id $community_id \
-op AddUserToCommunity \
-list_args [list $community_id $user_id]
+
+ # Send membership email
+ send_member_email -community_id $community_id -to_user $user_id -type "on join"
}
}
@@ -2202,5 +2205,68 @@
array set site_node [site_node::get_from_url -url $url]
return $site_node(package_id)
}
+
+ ad_proc -public send_member_email {
+ {-community_id:required}
+ {-to_user:required}
+ {-type "on join"}
+ } {
+ Send a membership email to the user
+
+ @author Roel Canicula (roel@solutiongrove.com)
+ @creation-date 2004-09-05
+
+ @param community_id
+ @param to_user
+ @param type
+
+ @return
+
+ @error
+ } {
+ if { [db_0or1row member_email {
+ select from_addr,
+ subject,
+ email
+ from dotlrn_member_emails
+ where enabled_p
+ and community_id = :community_id
+ and type = :type
+ }] } {
+ # Shamelessly cut & pasted from bulk mail
+ if { [empty_string_p $from_addr] } {
+ set from_addr [ad_system_owner]
+ }
+ set to_addr [cc_email_from_party $to_user]
+
+ set extra_headers [ns_set create]
+
+ set message_html [ad_html_text_convert -from html -to html $email]
+ # some mailers are chopping off the last few characters.
+ append message_html " "
+ set message_text [ad_html_text_convert -from html -to text $email]
+
+ # Send email in iso8859-1 charset
+ set message_data [build_mime_message $message_text $message_html]
+ ns_set put $extra_headers MIME-Version [ns_set get $message_data MIME-Version]
+ ns_set put $extra_headers Content-ID [ns_set get $message_data Content-ID]
+ ns_set put $extra_headers Content-Type [ns_set get $message_data Content-Type]
+ set message [ns_set get $message_data body]
+
+ # both html and plain messages can now be sent the same way
+ acs_mail_lite::send \
+ -to_addr $to_addr \
+ -from_addr $from_addr \
+ -subject $subject \
+ -body $message \
+ -extraheaders $extra_headers
+
+ set return_val 1
+ } else {
+ set return_val 0
+ }
+ return $return_val
+ }
+
}
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/member-email-toggle.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/member-email.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/member-email.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.adp,v
diff -u -r1.33 -r1.33.2.1
--- openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.adp 13 Jan 2005 13:57:32 -0000 1.33
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.adp 21 Jul 2005 22:55:06 -0000 1.33.2.1
@@ -39,6 +39,16 @@
#dotlrn-portlet.Manage_Membership# - #dotlrn-portlet.lt_AddRemove_pretty_name#
+
+ Edit Welcome Message
+ - Enabled
+ Enabled |
+ Disabled
+ Disabled
+
+
+ Create Welcome Message
+
Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.tcl,v
diff -u -r1.16 -r1.16.2.1
--- openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.tcl 24 Jul 2004 08:34:16 -0000 1.16
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.tcl 21 Jul 2005 22:55:06 -0000 1.16.2.1
@@ -82,3 +82,14 @@
# get the subcomm info
set rows [dotlrn_community::get_subcomm_info_list -community_id $community_id]
template::util::list_of_ns_sets_to_multirow -rows $rows -var_name subgroups
+
+# get member email notification
+db_0or1row member_email {
+ select
+ enabled_p as member_email_enabled_p
+ from
+ dotlrn_member_emails
+ where
+ community_id = :community_id and
+ type = 'on join'
+}
Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.xql,v
diff -u -r1.6 -r1.6.12.1
--- openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.xql 1 Jun 2002 02:18:57 -0000 1.6
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.xql 21 Jul 2005 22:55:06 -0000 1.6.12.1
@@ -18,4 +18,16 @@
+
+
+ select
+ enabled_p as member_email_enabled_p
+ from
+ dotlrn_member_emails
+ where
+ community_id = :community_id and
+ type = 'on join'
+
+
+