Subversion Repositories wimsdev

Rev

Rev 16581 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
16512 guerimand 1
!default step=1
2
 
3
!if $class_sendmailteacher=no
4
  error=sendmailteacherclose
5
  !reset job
6
  !exit
7
!endif
8
 
9
 
10
!if $step=1
11
  !if $target=supervisor
12
    !readproc adm/class/userdef ,$wims_class,
13
    tmp=!defof user_email,user_firstname,user_lastname in $userfolder/$wims_user
14
    sendermail=$(tmp[1])
15
    sendername=$(tmp[2]) $(tmp[3])
16
    tmp=!defof class_email,class_Supervisor,class_supervisor in wimshome/log/classes/$wims_class/.def
17
    !if $(tmp[2])=$empty
18
      recipientname=$(tmp[3])
19
      recipientmail=$(tmp[1])
20
    !else
21
      tmp=!defof user_email,user_firstname,user_lastname in wimshome/log/classes/$wims_superclass/.users/$(tmp[2])
22
      recipientmail=$(tmp[1])
16514 guerimand 23
      recipientname=$(tmp[2]) $(tmp[3])
16512 guerimand 24
    !endif
25
  !endif
26
!endif
27
 
28
!if $step=2
29
  !if $sendermail!=$empty
30
    !bound selfsend within 0,1 default 0
31
  !else
32
    selfsend=0
33
  !endif
34
  save_selfsend=$selfsend
35
  save_subject=!char 1 to 100 of $subject
36
  save_subject=!detag $save_subject
37
  !!  -------- for the moment use detag
38
  !!  script_data_input=!char 1 to 1000 of $msg
39
  !!!readproc adm/partialdetag.proc variable
40
  !! save_subject=$script_data_output
41
  save_msg=!char 1 to 1000 of $msg
42
  save_msg=!detag $save_msg
43
!endif
44
 
45
!if $step=3
16581 guerimand 46
  !if $wims_mail_hidden=yes
47
     sender=$empty
48
  !else
49
    sender=$sendermail
50
  !endif
16512 guerimand 51
    !mailto $recipientmail\
16581 guerimand 52
$sender\
16512 guerimand 53
[WIMS $wims_classname] $save_subject\
54
$save_msg\
17180 bpr 55
<br>\
56
#######<br>\
57
Send by : $sendername<br>\
58
#######<br>
16512 guerimand 59
 
60
 
61
  !if $save_selfsend=1
62
    !mailto $sendermail\
16581 guerimand 63
$sender\
16512 guerimand 64
[WIMS $wims_classname] $save_subject\
65
$save_msg\
17180 bpr 66
<br>\
67
#######<br>\
68
Copy of message send to : $recipientname<br>\
69
#######<br>
70
 
16512 guerimand 71
  !endif
72
  !if $wims_class!=$empty
73
    !set wims_module_log=class $wims_class: sendmail
74
    date=!translate : to . in $wims_now
16581 guerimand 75
    !appendfile wimshome/log/classes/$wims_class/.log $date $httpd_REMOTE_ADDR	$wims_user send mail to supervisor
16512 guerimand 76
  !endif
77
 
78
!endif
79
 
80
 
81