Index: openacs-4/packages/dotlrn-ecommerce/www/email-applicants.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/email-applicants.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-ecommerce/www/email-applicants.adp 16 Aug 2005 10:32:30 -0000 1.1 @@ -0,0 +1,7 @@ + + @title@ + @header_stuff@ + @context@ + @focus@ + + Index: openacs-4/packages/dotlrn-ecommerce/www/email-applicants.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/email-applicants.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-ecommerce/www/email-applicants.tcl 16 Aug 2005 10:32:30 -0000 1.1 @@ -0,0 +1,67 @@ +# packages/dotlrn-ecommerce/www/email-applicants.tcl + +ad_page_contract { + + sends out email to applicants + + @author Deds Castillo (deds@i-manila.com.ph) + @creation-date 2005-08-16 + @arch-tag: aa9fd47b-ab34-4d20-80dc-6c91076e1d37 + @cvs-id $Id: email-applicants.tcl,v 1.1 2005/08/16 10:32:30 dedsc Exp $ +} { + {rel_id:integer,multiple ""} + {return_url "applications"} +} -properties { +} -validate { +} -errors { +} + +if {[empty_string_p $rel_id]} { + ad_returnredirect $return_url +} + +permission::require_permission -object_id [ad_conn package_id] -privilege admin + +set title "[_ dotlrn-ecommerce.Email_applicants]" +set context [list [list "applications" "[_ dotlrn-ecommerce.lt_Waiting_List_and_Prer]"] $title] +set header_stuff {} +set focus {} + +ad_form \ + -name spam \ + -export { return_url } \ + -form { + {from:text(inform) {label "[_ bulk-mail.From]"}} + {recipients:text(inform) {label "[_ dotlrn-ecommerce.Recipients]"}} + {subject:text(text) {label "[_ bulk-mail.Subject]"} {html {size 60}}} + {message:richtext(richtext) {label "[_ bulk-mail.Message]"} {html {rows 20 cols 80 wrap soft}} {nospell 1}} + {send_date:date {label "[_ bulk-mail.Send_Date]"} {format {MONTH DD YYYY HH12 MI AM}}} + {query:text(hidden)} + } \ + -on_request { + set from [acs_user::get_element -user_id [ad_conn user_id] -element email] + set send_date [template::util::date::now_min_interval] + set user_id_list [db_list get_user_ids "select distinct object_id_two from acs_rels where rel_id in ([join $rel_id ,])"] + set query "select pa.email, pe.first_names, pe.last_name from parties pa, persons pe where pa.party_id = pe.person_id and pa.party_id in ([join $user_id_list ,])" + db_foreach get_recipients $query { + append recipients "$first_names $last_name ($email)
" + } + set message [template::util::richtext::create {} "text/enhanced"] + } \ + -on_submit { + set body [template::util::richtext::get_property content $message] + set format [template::util::richtext::get_property format $message] + ns_log Notice "DEDSMAN: $body : $format" + bulk_mail::new \ + -package_id [ad_conn package_id] \ + -send_date [template::util::date::get_property linear_date $send_date] \ + -date_format "YYYY MM DD HH24 MI SS" \ + -from_addr $from \ + -subject "$subject" \ + -message $body \ + -message_type html \ + -query $query + } \ + -after_submit { + ad_returnredirect $return_url + } Index: openacs-4/packages/dotlrn-ecommerce/www/sent-emails-one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/sent-emails-one.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-ecommerce/www/sent-emails-one.adp 16 Aug 2005 10:32:30 -0000 1.1 @@ -0,0 +1,45 @@ + + @title@ + @header_stuff@ + @context@ + @focus@ + + +#bulk-mail.Message_not_sent_yet# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#bulk-mail.Send_Date#@send_date@ 
#bulk-mail.From#@from_addr@ 
#bulk-mail.Subject#
@subject@
 
#bulk-mail.Reply_To#@reply_to@ 
#bulk-mail.Extra_Headers#@extra_headers@ 
#bulk-mail.Message#
@message;noquote@
 
#dotlrn-ecommerce.Recipients#
@recipients;noquote@
 
#bulk-mail.Status##bulk-mail.Sent##bulk-mail.Pending##bulk-mail.Cancelled#
+ + Index: openacs-4/packages/dotlrn-ecommerce/www/sent-emails-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/sent-emails-one.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-ecommerce/www/sent-emails-one.tcl 16 Aug 2005 10:32:30 -0000 1.1 @@ -0,0 +1,47 @@ +# packages/dotlrn-ecommerce/www/sent-emails-one.tcl + +ad_page_contract { + + view one detail + + @author Deds Castillo (deds@i-manila.com.ph) + @creation-date 2005-08-16 + @arch-tag: aa9fd47b-ab34-4d20-80dc-6c91076e1d37 + @cvs-id $Id: sent-emails-one.tcl,v 1.1 2005/08/16 10:32:30 dedsc Exp $ +} { + {bulk_mail_id:notnull,integer} +} -properties { +} -validate { +} -errors { +} + +set package_id [ad_conn package_id] +permission::require_permission -object_id $package_id -privilege admin + +db_1row select_message_info { + select bulk_mail_messages.bulk_mail_id, + to_char(bulk_mail_messages.send_date, 'Mon DD YYYY HH24:MI') as send_date, + bulk_mail_messages.status, + bulk_mail_messages.from_addr, + bulk_mail_messages.subject, + bulk_mail_messages.reply_to, + bulk_mail_messages.extra_headers, + bulk_mail_messages.message, + bulk_mail_messages.query + from bulk_mail_messages + where bulk_mail_messages.bulk_mail_id = :bulk_mail_id +} + +set subject [ad_quotehtml $subject] +set message [ad_quotehtml $message] + +set title $subject +set context [list [list "applications" "[_ dotlrn-ecommerce.lt_Waiting_List_and_Prer]"] [list "sent-emails" "[_ dotlrn-ecommerce.View_previously_email]"] $title] +set header_stuff {} +set focus {} + + +set recipients "" +db_foreach get_recipients $query { + append recipients "$first_names $last_name ($email)
" +} \ No newline at end of file Index: openacs-4/packages/dotlrn-ecommerce/www/sent-emails.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/sent-emails.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-ecommerce/www/sent-emails.adp 16 Aug 2005 10:32:30 -0000 1.1 @@ -0,0 +1,7 @@ + + @title@ + @header_stuff@ + @context@ + @focus@ + + Index: openacs-4/packages/dotlrn-ecommerce/www/sent-emails.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/sent-emails.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-ecommerce/www/sent-emails.tcl 16 Aug 2005 10:32:30 -0000 1.1 @@ -0,0 +1,53 @@ +# packages/dotlrn-ecommerce/www/sent-emails.tcl + +ad_page_contract { + + view emails sent to applicants + + @author Deds Castillo (deds@i-manila.com.ph) + @creation-date 2005-08-16 + @arch-tag: aa9fd47b-ab34-4d20-80dc-6c91076e1d37 + @cvs-id $Id: sent-emails.tcl,v 1.1 2005/08/16 10:32:30 dedsc Exp $ +} { +} -properties { +} -validate { +} -errors { +} + +set package_id [ad_conn package_id] +permission::require_permission -object_id $package_id -privilege admin + +set title "[_ dotlrn-ecommerce.View_previously_email]" +set context [list [list "applications" "[_ dotlrn-ecommerce.lt_Waiting_List_and_Prer]"] $title] +set header_stuff {} +set focus {} + +template::list::create \ + -name bulk_mails \ + -multirow bulk_mails \ + -elements { + send_date_pretty { + label "[_ bulk-mail.Send_Date]" + } + from_addr { + label "[_ bulk-mail.From]" + } + subject { + label "[_ bulk-mail.Subject]" + link_url_col details_url + } + status_pretty { + label "[_ bulk-mail.Status]" + } + } + +db_multirow -extend {status_pretty send_date_pretty details_url} bulk_mails bulk_mails { + select m.* + from bulk_mail_messages m + where m.package_id = :package_id + order by send_date desc +} { + set send_date_pretty [lc_time_fmt $send_date "%q"] + set status_pretty [ad_decode $status sent [_ bulk-mail.Sent] pending [_ bulk-mail.Pending] [_ bulk-mail.Cancelled]] + set details_url [export_vars -base "sent-emails-one" {bulk_mail_id}] +}